Change page-cache location
warmwhisky opened this issue ยท 2 comments
warmwhisky commented
Is there a way to change the location of the page-cache? currently it sits in public, but I was hoping to put it on a completely different drive.
I tried changing the htaccess to point to a drive on windows to test it out before trying on Centos in production but it stopped caching when I done that.
Any ideas?
thanks
omacranger commented
In case others come across, this, yes, it can be done by throwing something like below in a boot method of one of your app service provider:
use Silber\PageCache\Cache;
...
public function boot()
{
$this->app[Cache::class]->setCachePath(storage_path('/page-cache'));
}
Or any other path you would prefer in setCachePath
.
MarcosBL commented
Thank you very much @omacranger !
I used your trick to specify different folders for a website accesed through multiple domains