I’ve always used Cloudflare APO and I’ve never had a problem with my site’s home page updating when I make new posts or changes. (I had never used the Cache by Device Type option before)
Recently, I needed to enable the “Cache by Device Type” option, but I noticed a problem. After I made a post on my site, I noticed that my site’s homepage only updated on its PC version, while the site on the mobile version remained the same, it was not updated, and it did not show the new post that I had published .
I got to do tests. I cleared all browser data/cache on my phone, tested it on other browsers, and the homepage was still not updated.
I use the WP-Rocket plugin, and it also has the option to cache by device type enabled. I didn’t need to change anything on it. My first action was to purge Cloudflare’s cache, and as soon as I did that, the homepage of my website on mobile devices, in this case the cell phone, was successfully updated and the new post appeared.
What to do in a situation like this? Because logically speaking, the cache should be updated for all device types when “Cache by Device Type” is enabled and some publication or change is performed, right?
I did some tests, and it’s not just the mobile homepage of my website that doesn’t update, but also the posts.I edited some of them, and while the updated version of them appeared normally on the PC version of my site, on mobile, the posts remained in the previous version.
I have a test website with APO for WordPress and Cache by Device Type enabled. I just added a post to test it, and I got the expected updated initial page on all variants (desktop, tablet, mobile) — except for some Safari requests on a very old tablet, which I blame on Safari’s own persistent cache policy. So this doesn’t seem to be an APO issue per se.
I’d focus on the interaction between Cloudflare and your local settings. On the Cloudflare side, make sure you don’t have any Page Rules or Cache Rules that may be overriding APO in terms of caching. On the WordPress side, besides your caching plugin, make sure you check your theme’s configurations for any related settings.
Not if you have your site set correctly. APO will detect any new content and purge only the necessary pages. I just edited an old post in my test APO website and it instantly updated the content of the post on both desktop and mobile versions. So it doesn’t seem to be an issue with APO, but something with your settings.
You may want to raise the issue with WP-Rocket developers after performing a on their support forum.
You could set a Cache Rule for the homepage with an Edge Cache TTL set to whatever time in seconds you think it’s good, OR set it to respect origin headers and make sure your origin is sending a “must-revalidate” instruction as part of your Cache-Control header for the homepage. In any case, you need to set and test, and always remember to purge the relevant caches while testing.
The first link points to an unrelated issue of which Cloudflare is aware, and for which a temporary solution was proposed here.
As for the issue this topic is about, as I have said, I have a test APO site with local cache turned off, and both homepage cache and that of pages with updated content is purged correctly by APO, for mobile, tablet, and desktop devices.
Have you reached out to your caching plugin developers as suggested?