Skip to content

Caching problems: old pages, or pages that should be cached and are not

Fix a page that shows old content after an edit, a logged-in page cached for everyone, or a page that never caches. Read the cache headers, then change the rule or purge the cache.

Avaloi caches public pages at the edge and keeps a second cache on the server. Most caching problems come from one of three things: a page that was changed but still shows the old version, a page that is cached when it should not be (for a logged-in user, say), or a page that never caches so every visit runs PHP. The cache headers tell you which one you have.

What you see

  • You changed a page or a product and the old version still shows for some visitors.
  • A logged-in person sees another person's details, or a cart that is not theirs.
  • A page is slow every time, even though it should be fast after the first visit.

Check these first

  1. Read the cache headers. Open the page in your browser's developer tools, or run curl -I on it, and look at x-avaloi-cache and x-avaloi-cache-reason. HIT means the edge answered. MISS means the page was built and stored. BYPASS means it was not cached, and the reason header says why, such as a cookie or a logged-in user.
  2. Check the cache settings. Open the site, then Caching. Look for a path rule that excludes the page, and for query parameters that make a new copy for every visit. Pages are kept for one hour and static files for 30 days by default.
  3. Check the cookies. A response that sets a cookie is never cached, so a plugin that sets one on every page stops caching for everyone. The reason header shows BYPASS in that case.
  4. Check the logs. Open Logs and pick cache.log to see the cache result for many requests at once.

Fix it

  • Old content after an edit. Open Caching and purge the page or the whole cache. The purge clears the edge and the server together. Then reload the page with the cache bypassed in your browser to check.
  • Logged-in content cached for everyone. Avaloi never caches a response for a logged-in visitor or a visitor with a cart. If one did get cached, purge the cache at once, then find the cookie or path rule that let it through. Add that path to the exclusion list under Caching.
  • A page that never caches. Find the cookie that the reason header names. If a plugin sets it on every page, turn on Strip Set-Cookie under Tools, then purge. Only do this when the cookie is not needed for the page.
  • Query strings split the cache. Add the parameter to the list of ignored parameters under Caching. Marketing parameters such as utm_source are ignored already.
  • Saving a change applies it at the edge through a job. Watch the job on Jobs, then check the headers again.

Not yet

  • Purge history and cache statistics are not shown in the dashboard yet. The purge action works, but you cannot see when the last purge ran.

Still stuck?

Email [email protected] with your site name and what you tried, or send us a message.