litespeedtech / lscache-laravel

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

Purging multiple (or at least two) slugs #6

Closed darkponyhq closed 4 years ago

darkponyhq commented 4 years ago

Hi,

We are trying to purge single articles + the homepage of a website upon updating a single article.

Having:

LSCache::purge('/an-article-slug'); // the article we update
LSCache::purge('/'); // the homepage 

does not work since headers are already send.

Is it possible to have purge extended in order to support multiple slugs (similar to multiple tags)

e.g.

LSCache::purge('/slug1', '/slug2', .... )

Thanks

lucasRolff commented 4 years ago

You can simply do:

LSCache::purge('/an-article-slug,/');

That will purge both entries.

You can also assign your pages tags using lstags and purge based on this.

darkponyhq commented 4 years ago

Fantastic,

why don't you add this to the documentation?

TA

lucasRolff commented 4 years ago

It has been added to the README file.