Hello, I want to always have all the products and catalog pages in the cache.
The problem is that after 10-12 hours the cache disappears, and it always asks server data from the origin.
How can I make the cache always available, and when the stock changes to available or unavailable, request a new copy from the server, but let the user receive the old cache until the new one is updated?
I want the visitor to always receive the resources from the cache, and when the stock changes, I want cloudflare to request a new copy in the server, but until it is served from the origin, to offer the visitor the old cache.
I want visitors to have a quick experience on the site.
I have the Pro Plan and Cache Reserver service.
Hello,
With Cache Reserve, you should be able to achieve your objective, as it’s supposed to keep files in cache for 30 days. However, this is dependent on your cache-related headers, such as Cache-Control
, Expires
, CDN-Cache-Control
etc. to be able to properly purge the cache when changes are made. You need either a plugin or a script that handles that.
Also, Cache Reserve has some pre-requisites:
Also,
Cache Reserve should be used with Tiered Cache enabled. Cache Reserve is designed for use with Tiered Cache enabled for maximum origin shielding.
If finding/developing a solution to properly invalidate your cache is too much of a hassle, you might want to consider using APO for WordPress instead of Cache Reserve, as APO has its own cache invalidation logic built-in, specifically made for WordPress websites.