Ali Samie Posted August 10, 2022 Share Posted August 10, 2022 Hi community. I am trying to use this Cache::store($key, $value) method in order to save some data for later use. I failed. I also enabled the cache in BO and again failed. I tracked the debugger and this method Cache::isStored($key) returns false in first call during the runtime process. Then in the middle of runtime after calling Cache::store($key, $value) then Cache::isStored($key) returns true and the value is saved properly. But when the process ends it gets deleted. Why? Any idea how to use cache in prestashop? Link to comment Share on other sites More sharing options...
Ali Samie Posted August 10, 2022 Author Share Posted August 10, 2022 Just found this:https://stackoverflow.com/a/40387872/5864034 1 Link to comment Share on other sites More sharing options...
Ali Samie Posted August 10, 2022 Author Share Posted August 10, 2022 for lazy people $cache = Cache::getInstance(); $cache->set($key, $data, $ttl); $cache->get($key); $cache->exists($key); Link to comment Share on other sites More sharing options...
Ali Samie Posted August 10, 2022 Author Share Posted August 10, 2022 I still get false in return of this method Cache::getInstance()->set($cacheKey, $myValue) Link to comment Share on other sites More sharing options...
Ali Samie Posted August 10, 2022 Author Share Posted August 10, 2022 This seems like wont work in localhost and I have to setup a memcache server for this then connect it through the BO Link to comment Share on other sites More sharing options...
ventura Posted August 10, 2022 Share Posted August 10, 2022 There are many info in classes/cache/Cache.php Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now