Skip to content

Cache is not available in cross script execution #836

Answered by Geolim4
rahulradixweb asked this question in Q&A
Discussion options

You must be logged in to vote

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:

$InstanceCache = Phpfastcache\CacheManager::getInstance('files', new \Phpfastcache\Config\ConfigurationOption([
        "path" => "/tmpcache/",
        "defaultTtl" => 2629746        
    ]));

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@rahulradixweb
Comment options

Answer selected by rahulradixweb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants