Answer the question
In order to leave comments, you need to log in
How to use the same cache on different domains in Laravel?
Hello.
I have my own VDS.
It contains Memcached, Apache
Most of the data I enter into Memcached
There are two sites api.site.ru and operator.site.ru
Requests from applications come to api.site.ru , everything
is written to the cache like this
$value = Cache::rememberForever('users', function() {
return DB::table('users')->get();
});
Cache::forget('users');
Answer the question
In order to leave comments, you need to log in
Look at the implementation. /Illuminate/Cache/MemcachedStore
There, on line 103 , you can see that prefix is used in addition to the key:
I did not dig deeper into the Laravel sources. Most likely, the prefix consists of a unique key from the config.
For your task, you need to find the moment of initialization of this Store and make sure that the same prefix is used for both api and operator.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question