WordPress APO Not Purging Cache

Since enabling WordPress APO, our users have discovered that publishing edited content in WordPress does not automatically purge the cached version of the page or post that was edited. The only thing that works is manually purging—either by URL or the entire cache.

We are running v3.8.7 of the Cloudflare plugin with the default settings. I have tried disabling and re-enabling APO via the plugin. APO reports itself running against both the root domain and the www subdomain. In our case, www is canonical, and we have a redirect set up in Nginx to ensure it. I see the appropriate custom headers indicating that APO is functioning. It seems to be working correctly, other than not purging pages that have been updated in WordPress.

We use Bedrock, which does reorganize some core WordPress folders. I suppose my next step will be to trace through the plugin code to see if there’s an incompatibility with Bedrock that causes it to be unable to detect changes or trigger the cache purge. I thought I’d post here first though, just in case other community members are having the same problem.

What’s the site that has cache purge issues? Is it reproduced consistently or intermittently?

The site is GeoEx. I believe the issue is consistent. I for a time had enabled APO on our staging site and did not see the issue there. (I have since disabled APO on the staging site.)

I don’t see any issues with the plugin configuration on your site, there is a way to enable logging within the plugin, so you can see the list of URLs that get’s purged on content change in the debug logs. Please let us know if there is something problematic there.

2 Likes

OK, I’ve enabled the setting in config.json. Does the plugin create its own log, or do I have to enable debug logging in WordPress?

I figured it out and temporarily enabled WP debugging and logging. The plugin appears to be attempting to purge the correct files. I edited the post Unexpected Antarctica and then checked debug.log. The log does include that URL in the list of URLs purged; however, the page wasn’t actually purged from the cache until I removed it manually.

Oddly the log includes both http:// and https:// versions of the URL. The site is configured with “full” Cloudflare SSL, and Nginx is configured to redirect non-SSL to SSL on the origin server.

The log does include that URL in the list of URLs purged; however, the page wasn’t actually purged from the cache until I removed it manually.

this is strange, could you try to generate a new API token using WordPress template?

Oddly the log includes both http:// and https:// versions of the URL. The site is configured with “full” Cloudflare SSL, and Nginx is configured to redirect non-SSL to SSL on the origin server.

This is plugin logic to purge both versions just in case, there are always edge cases :slight_smile:

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