{"id":19027769,"date":"2026-09-23T20:59:09","date_gmt":"2026-09-23T20:59:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/error-with-cdn-since-last-version\/"},"modified":"2026-09-23T20:59:09","modified_gmt":"2026-09-23T20:59:09","slug":"error-with-cdn-since-last-version","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/error-with-cdn-since-last-version\/","title":{"rendered":"Error with CDN since last version"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We have identified a reproducible issue with EventPrime 4.3.4.8 when the frontend calendar page is served through full-page CDN caching.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The calendar works correctly for logged-in users, but fails for logged-out\/guest visitors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The failing AJAX request is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">action: ep_get_calendar_event<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The request includes a security nonce, for example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">security: 14840fe884<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For affected guest users, the AJAX response is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{<br \/>&#8220;success&#8221;: false,<br \/>&#8220;data&#8221;: {<br \/>&#8220;message&#8221;: &#8220;Security check failed. Please refresh the page and try again later.&#8221;<br \/>}<br \/>}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The frontend JavaScript then generates a secondary error:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Uncaught TypeError: data.data.map is not a function<br \/>at ep-frontend-events.js?ver=4.3.4.8<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We confirmed the root cause is full-page caching through BunnyCDN.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the EventPrime\/calendar page is excluded from BunnyCDN caching, the issue immediately disappears.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It appears EventPrime is generating the AJAX nonce\/security token in the frontend HTML. That HTML is then cached and served to anonymous visitors after the nonce is no longer valid. Logged-in users are unaffected because they bypass the guest page cache and receive a fresh nonce.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There appear to be two issues:<\/p>\n\n\n\n<ol start=\"1\">\n<li>The EventPrime AJAX nonce is not compatible with long-lived full-page caching for anonymous visitors.<\/li>\n\n\n\n<li>The frontend JavaScript assumes <code>data.data<\/code> is always an array and calls <code>.map()<\/code> even when the server returns an error object.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Ideally EventPrime should support frontend page caching without requiring the entire calendar page to be excluded from CDN\/page caching.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Possible approaches would be to obtain\/refresh the nonce dynamically, use an AJAX\/REST design that does not rely on a nonce embedded in cached HTML for a public read-only request, or otherwise make the frontend request cache-safe.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The JavaScript should also check <code>success<\/code> and verify <code>Array.isArray(data.data)<\/code> before calling <code>.map()<\/code>, so a nonce failure produces a meaningful error instead of a TypeError.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please let me know if you need additional request\/response data or testing.<\/p>\n","protected":false},"template":"","class_list":["post-19027769","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19027769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19027769\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19027769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}