Closed eliassdogos closed 3 years ago
you are mistaking the LiteSpeed Cache and Browser Cache.
for Cache-Control: public,max-age=108000
you need to use .htaccess with Header directive , e.g.
Header set Cache-Control "public,max-age=108000"
but be careful , this will force browser to cache dynamic pages which serves user the out-dated or stalled content , you may not want to do this over a dynamic page.
@qtwrk thank you about browser cache, Also what about LScache => Route::get('/', 'Controller@index') ->middleware(['lscache:max-age=108000;public;', 'lstags:home']); Why i dont see lstag and max age in headers https://i.imgur.com/e9XiXQd.png ?
yes, it's hidden header , you can only see it in server debug log.
only visible to end-user is x-litespeed-cache
header , the tag and TTL header won't show
Thank you.
@qtwrk since the tag and TTL header won't show why i can see tag "Admin" in another route. https://i.imgur.com/D1dKkUV.png In web.php routes i have Route::group(['prefix' => 'admin', 'middleware' => ['lscache:no-cache;', 'lstags:admin']], function () {
... .. .. }
Internal/Hidden headers are always exposed with no-cache
and whenever the request is a miss
(didn't hit cache). When you get a hit
those internal/hidden headers are not present.
Thank you
I installed lscache with these steps https://docs.litespeedtech.com/lscache/lsclaravel/installation/. At .env i have LSCACHE_ESI_ENABLED=true LSCACHE_DEFAULT_TTL=108000 At laravel/public/.htacess
< IfModule LiteSpeed > CacheLookup on </ IfModule > In web.php for homepage i set Route::get('/', 'Controller@index') ->middleware(['lscache:max-age=108000;public;', 'lstags:home']);
but in f12 i am ok with X-LiteSpeed-Cache: hit X-LS-Pagespeed: 2.1-1.11.33.4 https://i.imgur.com/e9XiXQd.png but how to set "Cache-Control: public,max-age=108000" instead "Cache-Control: no-cache, private,public" and see tag "home"?