‘I have cleared the LS cache, but still the same issue.’
Wait some minutes. Maybe there is a delay until the purge action has been done.
Thread Starter
kk25
(@kk25)
Tried everything suggested.
- added lines in htaccess
- purged the cache
Still cache is showing as 7 days!
Thread Starter
kk25
(@kk25)
Pagespeed also have a delay and caches results, so wait until tomorrow….
Plugin Support
qtwrk
(@qtwrk)
there are 2 possible cases
- if you are using OpenLiteSpeed, then htaccess way won’t work , but this seems not the case ?
- something on your server level has overrided your htaccess directive or your server setting does not allow htaccess to override the header
Thread Starter
kk25
(@kk25)
Yes, I am using OpenLiteSpeed. There is no setting on my server which prevents or overrides. Can you please provide a solution?
Plugin Support
qtwrk
(@qtwrk)
for OLS, please check this guide
Thread Starter
kk25
(@kk25)
Just let me know what is to be done instead?
Plugin Support
qtwrk
(@qtwrk)
please check above doc
basically you need to go to OLS webadmin console -> your virtual host -> context, create a new context that matches the static resources , and then set header directives there.
Thread Starter
kk25
(@kk25)
@kk25
Expire header is correctly set. You can verify it by your own if you use web dev console in your browser, but it seems that CDN cache for static sources has not been updated in all nodes. Did you already try to purge CDN cache?
btw. Pagespeed expects 365 days or 31536000 s for expiring time or cache-control.
Plugin Support
qtwrk
(@qtwrk)
- cache-control: public, max-age=15552000
- content-encoding: br
- content-length: 11709
- content-type: application/x-javascript
- date: Wed, 28 Dec 2022 02:01:19 GMT
- etag: “9efa-63ab5c87-239383;br”
- expires: Mon, 26 Jun 2023 02:01:19 GMT
I can see both cache-control and expire has been set to 180 days
you can further make it 365 or any period you desire