Campaigns block

Cache duration and manual sync

Campaign data and signup form field definitions are both cached in a WordPress transient, so neither one calls the Laposta API on every page view. Cache duration defaults to 60 minutes and is configurable (1–1440 minutes) from Wynko → Settings, or via the WYNKO_CACHE_MINUTES environment variable / wp-config.php constant. The last refresh time is shown under the field.

Sync now immediately busts the cache and re-fetches campaigns from Laposta, regardless of the configured duration. Success or failure shows as an admin notice, and a row is added to the activity log — including a note when new campaigns are detected. Refreshes that happen automatically when the cache expires are logged too, worded as “Automatic sync” so you can tell the two apart.

When a form’s cached fields fall out of sync

If a list’s fields change in Laposta between refreshes, a form can briefly hold a stale, cached copy. Wynko doesn’t wait for the cache to expire on its own here: the first submission that fails against the cached definitions triggers an immediate resync with Laposta, and the mismatch is logged. The visitor’s next attempt is validated against the current definitions, so a form can only drift out of sync for a single failed attempt before it corrects itself.

That covers a field becoming required or changing shape. A brand-new optional field is different: a submission from a form that predates it still validates fine, so nothing fails and nothing forces a resync. If your form pages are also served by a page-caching plugin or CDN, that stale copy can keep being shown. Wynko leaves a quiet signal for this — a note in the activity log that a signup “carried an outdated field fingerprint”, at most once an hour per form — which is your cue to purge that page. See Page caching and CDNs for the full picture.

Purging a page cache automatically on sync

Wynko’s data cache and a page-caching plugin are separate layers: after Sync now Wynko’s own data is fresh immediately, but a front-end page showing it stays on the older version until that page cache expires or is purged on its own. To purge automatically, a developer can hook wynko_cache_busted or wynko_campaigns_synced and call the caching plugin’s own purge function — see Hooks and filters.