With Laravel I want only non-login users to keep cache.

#1
Hi,
https://docs.litespeedtech.com/lscache/lsclaravel/installation/
I have installed the cache, but I want the cache to work when the user is not logged in.
This is how I configured the following files.

lscache.php
<?php

return [

'esi' => env('LSCACHE_ESI_ENABLED', true),

'default_ttl' => env('LSCACHE_DEFAULT_TTL', 1800),

'default_cacheability' => env('LSCACHE_DEFAULT_CACHEABILITY', 'public'),

'guest_only' => env('LSCACHE_GUEST_ONLY', true),
];
.htaccess
<IfModule litespeed>
CacheLookup on
RewriteEngine On
RewriteRule .* - [E=cache-control:no-cache]
</IfModule>


I want only non-login users to keep cache.
I don't want logged in users to keep cache.

Is there any cache blocking for the desired *.php file in Laravel?

It is stated that there is only cache blocking in this way.
Route::get('/login', function() {
return view('login');
})->middleware('lscache:no-cache');
But I also want to block /login or *.php file.
Is there a solution?

thanks.
 
Top