Cache isn't working?
I'm having issues keeping the cache for the amount of time that's it is configured for.
- I load the page and it is a Cache MISS
- I reload again and it's a Cache HIT
- I wait 1 minute and it's a Cache MISS...
I've configured Cache Duration to 14400 seconds, but it seems to be entirely ignored.
Wassim last edited by
- What AppDrag component are you referring to ? A website page ? A Cloud API Function ? Which method (GET/POST) ?
- How do you define the cache?
- What do you see in the response headers for the cache duration?
- It's a GET request, but the page uses Cloud API function to render HTML.
- It uses Query parameters, but even when they're the same (no change), there's no cache.
- What do you mean? It's only a setting under Optimize?
Here's without Cloudflare and a page without Query Parameters:
Just tried with a blank page, same issue, cache only lasts a few seconds...
You have not disclosed the url so I can't check...
@jbenguira I've sent them in a PM
Joseph Benguira last edited by Joseph Benguira
@thomasd OK I checked your url and PM
in fact caching affect only resources, not the HTML pages ...
in our setup .html files are always returned with this header
cache-control: public, must-revalidate, max-age=0
but it will still be cached for a maximum of 30 seconds
FYI from a cloud function (in gateway mode) you can set any http header
including something like this
Since you use Cloudflare, another option is to activate caching from there
you can do that with a "Page Rule"
I've tried using Cloudflares pagerule "Cache everything" - but since the headers invalidate cache, Cloudflare will do the same and set pages to "Dynamic" mode.
"Whether we actually store the asset and for how long is determined by the Cache-Control headers returned with responses from the origin server"
Using Edge Cache TTL makes it possible, but that disables all cookies....
This means the potential API requests for this site with 400 products and 2x languages would be 2.3M requests in 24 hours....
Can you please change the admin text for cache duration, it's very missleading if it's only for assets and not content (as the text says).