Jump to content

Caching of data


snuswdk

Recommended Posts

Hi, 

 

We have created some custom pages, where we are forced to run a lot of sql statements. 

The data can be cached for a couple of days or untill we clear the cache. 

 

My prolem is it don't store the cache. Everytime the funciton Cache::isStored returns false.

$cache_id = "test";
if (Cache::isStored($cache_id)) {
   /// Query data
   Cache::store($cache_id, $data);
}

$data = Cache::retrieve($cache_id);
echo json_encode($data);

I think I uses the cache function wrong. But I can seem to find any documentation for it. 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...