Closed bridgeport closed 4 years ago
There is already a PR that was submitted nearly a month ago that will recursively delete a directory, just waiting for it to be merged. https://github.com/JosephSilber/page-cache/pull/58
You can use Laravel's withoutMiddleware
on your route, to exclude it from caching:
Route::get('/', 'HomeController@index')->withoutMiddleware('page-cache');
To clear a full resource, use the new --recursive
flag.
Thanks for this package. Three suggestions:
1) Add a
PAGE_CACHE_ENABLED
environment variable with supporting config file that checks for this. This allows the cache to be turned on and off instead of having to comment out the reference inKernel.php
2) You have a
page-cache
route middleware, but how about doing the inverse: ano-page-cache
middleware? This'll allow an individual route(s) to be excluded easily while caching everything else by default.3) Regex cache clearing. Right now, an individual slug can be cleared:
But what about extending it to clear a directory, like so:
Or just clearing anything that matches:
If full-blown regex is too much work to do, at least supporting the asterisk seems to be a reasonable middle ground.
Thanks.