Smart cache library was created to over come the limitation in Codeginiter output caching. In CodeIgniter output caching when a valid cache file exists for a request then the controller is not executed at all and you don't have a control when to to serve from cach once you have created the cache file. In the Smart cache library you serve the cache and can do more than that.
PCG utilize this library where ever applicable to make the generated websites faster. You can download smart cache library for free from our GitHub source.
This functions save the data with the given file name and expiry date.
$filename is the relative path from the cache root directory.
$data is what needs to be stored in the file. Generally we save the output HTML from the views.
$expiry is the default expiry time for the cached data. If not provided the data will be cached for unlimited time unless it is not deleted by using the delete_data or delete_all_data methods.
This function reads the data from the filename and return the content of it. Please note that if the file expiry is passed then FALSE is returned from this function.
$filename will be same as the relative file path used when saving the data.
This is same as get_data($filename) function but place the output directly in the CodeIgniter output buffer..
Returns TRUE when output is replaced by cache and FALSE when no cache exists.
Delete the cache file by filename.
Delete all the caches files in the given directory.
Please send your questions using the contact us form.