Cache Header

#1
Hello,

I'm testing Cloudflare Cache-everything and accordingly to the guide, the cache-everything will respect all existing header.

Unfortunately, Cloudflare does not support strong etag which litespeed cache output, it only support weak etag.

Is there any header to tell cloudflare that the page cache has been updated? Otherwise it will continue server first cache version from its source!

Thank you.
 

mistwang

LiteSpeed Staff
#2
Unfortunately, it is how a dummy web cache works, you can not expect that cache will update following the updates in original server, unless you purge it manually.
https://support.cloudflare.com/hc/en-us/articles/200169246-How-do-I-purge-my-cache-

Cloudflare support strong etag, but it has nothing to do with your cache problem.
https://support.cloudflare.com/hc/en-us/articles/218505467-Does-CloudFlare-support-ETag-headers-

If stale cache cause trouble for your site, you should not use it.

I would use short expire time even if "Cache-everyting" option does not break the site.
 
#3
Thank you for the info.

So, is there anyway to display the cache-control:max-age on the cached page? In the admin dashboard, I set

Default Front Page TTL = 900 second

But on the cached page I don't see cache-control information.
 

NiteWave

Administrator
#4
it's likely cloudflare remove or modify "cache-control:max-age" header, depending on your price plan with cloudflare.

you can add another header like "my-cache-control:max-age=900", cloudflare won't modify it and just bypass, so you can see the customized header.
 

NiteWave

Administrator
#7
the cache-everything will respect all existing header.
tested on a server, for cloudflare's "Cache Everything" feature, there is a "Browser Cache TTL" option. the available values:
https://support.cloudflare.com/hc/en-us/articles/218411427
"Free, Pro, and Business customers can set TTLs ranging from 30 minutes to 1 year; Enterprise customers have additional options down to 30 seconds, and can choose to respect the existing max-age header."

so only Enterprise customers can choose to respect the existing max-age header.
 
#8
it's likely cloudflare remove or modify "cache-control:max-age" header, depending on your price plan with cloudflare.

you can add another header like "my-cache-control:max-age=900", cloudflare won't modify it and just bypass, so you can see the customized header.
How can I add a new header "my-cache-control:max-age=900" please?

Is it the same behavior as add Expires Settings on in Litespeed webserver?
 
Top