Cache is not available in cross script execution #836
-
Hello, We have one common file that is included in every execution say common.php with following code common.php
from one file I set cache say, file1.php that includes common.php like
Now I want to access that cached data in file2.php that includes common.php like.
But I get empty item as $InstanceCache is a new fresh instance, Your support is appriciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It's because you call In your case you can do the following:
|
Beta Was this translation helpful? Give feedback.
-
And please read carefully the WIKI and the DOCS. You can also look at the way I wrote the tests too. There's many documentation you can use to implement Phpfastcache. |
Beta Was this translation helpful? Give feedback.
It's because you call
CacheManager::setDefaultConfig
after building your cache instance.using
CacheManager::setDefaultConfig
is useful if you have multiple cache pool instances.In your case you can do the following: