Open MazzMazz opened 2 years ago
We are facing the same challenge.
Any updates on this?
If you are not caching the routes in production, you can have each domain have it's own page cache using the following command:
use Silber\PageCache\Cache as PageCache;
app()->make(PageCache::class)->setCachePath($folder);
This works well if you have a separate routes/domain.php
file per domain rather than using the default routes/web.php
. Just at that command to the top of each routes file.
Update: While this seems like it should work, I'm seeing the cache path only being able to be overridden for one location. I also looked into building multiple middleware, using an anonymous function to create an instance of CacheResponse
with it's own Cache
object, but this also was tricky. I think the best option here is to add the ability to provide a path as a middleware parameter.
Is it Somehow possible to make a subdirectory for the cache? We serve multiple domains via one laravel Project.
e.g. testsite1.de, testsite1.at, testsite1.com
unfortunately the index file is always overwritten and/or serves the wrong website.