cloudflare / Cloudflare-WordPress

A Cloudflare plugin for WordPress
https://www.cloudflare.com/wordpress/
BSD 3-Clause "New" or "Revised" License
215 stars 84 forks source link

APO Cache is Not Cleared on Tablet #500

Closed jfireman closed 11 months ago

jfireman commented 1 year ago

Confirmation

WordPress version

6.1.1

Cloudflare-WordPress version

4.11.0

PHP version

7.4.27

Expected result

APO clear cache after content update for all device type including tablet

Actual result

Only desktop and mobile version cache is cleared, tablet version still display old content

Steps to reproduce

Activate the plugin Activate APO Activate "Cache by device type" View content to be updated on mobile, desktop, and tablet Update content Reload and view the updated content on mobile, desktop, and tablet

Additional factoids

I've tested this issue with iPad (emulated), Android tablet (emulated and on device), and Kindle Fire HDX (emulated) and all are displaying old contents.

For now, I set a page rules in Cloudflare to bypass all cache for tablet only in order to show the fresh content.

References

The issue is similar to this one: https://github.com/cloudflare/Cloudflare-WordPress/issues/404 but this time it's for tablet device

elliott-stocks commented 1 year ago

I'm able to replicate this too, but it seems that the cache is eventually purged if you refresh the desktop version a few times.

Steps to replicate -

  1. Publish a post and view in incognito mode
  2. Emulate an iPad in Chrome devtools
  3. Update the post title
  4. Refresh the incognito window
  5. The page title isn't updated
  6. Disable emulate mode and refresh again - the title is updated (as it's desktop)
  7. Switch back to emulate mode and refresh - the title is now updated

I'm assuming that the "default" cache key is always desktop, which is why there's no logic for purging cache specifically for desktop in the plugin. As of now there's only a method for clearing the mobile cache.

PR opened in #505.

JustinFreid commented 1 year ago

Does changing the Edge Cache TTL to be very short help fix this issue even if it puts slightly more load on the Origin?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.