APO - No Cache Update on news site!

Wordpress APO, won’t update cache without a manual clear cache! Wordpress plugin enabled

Hello,
Do you have an example of URL that is not cached as expected?

https://www.dimokratianews.gr/ - Here for example, we have

  1. cf-cache-status:HIT
  2. cf-edge-cache: cache,platform=wordpress
  3. cf-ray: 5dc66195ef749e97-ATH

but when content (e.g Homepage) gets updated, for example someone posting a new post, the homepage wont be updated and i have to clear the cache manually from Cloudflare Dashboard.

@petr00kos please make sure you navigate to APO card in the WP plugin, there is a minor possibility that automatic cache purge from WP plugin is not activated, just fetching the APO card in the WP plugin should fix it.

The reason for that unfortunate edge case as we don’t want to call Cloudflare API every time the content on the site is updated to know if APO feature is enabled. That’s why we sync APO setting value to WP plugin internal storage.

as you can see my plugin is enabled and APO feature is enabled, although when someone makes a new post, cache not getting cleared!

I believe @yevgen was referring to this setting. EDIT: I’m not using APO on this site, but confusingly, the instructions here say to NOT enable this feature if you’re using APO.

1 Like

I believe not because this feature saying “This feature is superseded by Automatic Platform Optimization for WordPress. If you are using APO, then this setting should be disabled.” and if this feature is enabled DELETES EVERYTHING in cache (html, css, images etc) i only need the HTML be refreshed (as Cloudflare Workers work)

I refer to “Automatic Platform Optimization” card on Home page of WP plugin. “Auto Purge Content On Update” is not needed and should be disabled.

1 Like

I have a guess why @petr00kos experiences issues with cache purge. This could be an edge case we aim to address next week (still requires brainstorming about best way to resolve it). Then the website is accessible both from www.example.com and example.com without redirection APO caches those urls independently. Then the new content is published WP plugin purges cache only for one case but not both.

One way to fix it for a specific website is to update DNS configuration so the site redirects from www.example.com to example.com or vice versa.

1 Like

couldn’t you just code in CF Wordpress plugin to read the Wordpress main site url as the primary to work on ? Then Wordpress code already has an internal redirect for non-primary site url redirects itself which you see via HTTP response header X-Redirect-By: WordPress

1 Like

Yes, this is part of the solution (purging cache against primary site url), the other part is to keep only a single copy of the content in cache.

1 Like

So for now do we have any solutions ? I ve tested with 5 sites and all of them have the same problem.
APO is working alright, all headers are OK, but when content is updated, cache not getting purged.

might be enough to setup a CF page rule to redirect to your primary Wordpress settings URL so if that is domain.com, setup page rule for www version to redirect to non-www or do it via origin web server which is what I did for my tests with WP APO at https://community.centminmod.com/threads/cloudflare-wordpress-plugin-automatic-platform-optimization.20486/

Or expose CF Enterprise feature for custom cache key so that cache key for CF Worker caching is always just the Wordpress primary site URL?

Yes, something along this lines.

1 Like

so it seems that everyone needs caching purge will have the same problem :confused:

I ve already setup NGINX redirect and it doesnt work :frowning:

I’d imagine using a custom cache key tied to WP site settings URL will probably solve the issue with the current limitation for Automatic Platform Optimization only working on main apex domain i.e. domain.com and not subdomains as each WP site settings URL would be unique as would the cache key used?

bump!

do we have any solution yet sir ?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.