litespeedtech / lscache-laravel

LSCache for Laravel framework
GNU General Public License v3.0
51 stars 14 forks source link

cache half of screeen #24

Closed ehsanwwe closed 2 years ago

ehsanwwe commented 2 years ago

hello thanx for port this awsome plugin for Laravel users

i have a search page i want to cache just filters in right of the page not total of the page have you any way to do it for me ?

lucasRolff commented 2 years ago

You'd have to use an ESI block to do this, so the ESI block would define it should be cached for example 5 minutes, and then not define any cache for the page itself.

However, in a case like this, you'll likely not benefit at all, since the filters themselves (should) be fairly quick to render, and the results should be what takes longer.

Personally I would instead cache the filters using the Laravel Cache helper ( https://laravel.com/docs/8.x/cache ), and simply store your result of the query output in the cache managed directly by Laravel, at least in my opinion that would make more sense for such fine-grained scenarios; After all, there's nothing bad in using various ways of caching various functionalities within a given application.