• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cache library

Nah, it works just great for me.

How do I use this cache library with Ocular templating library?

A very useful library, Thank you.

this caching lib is more recent.

Hi, how can I save the cached data in application/cache folder instead of system/folder ? I have different CI folder structure .. here's my folder structrure

> application
- cache
.. another folder

> system
- cache
.. another folder

Wow. Nicely done! I was just about to implement something identical to this, and thought I'd go for a quick search. You've made exactly what I was planning! Thanks very much.


Edit: Within five minutes of installing it (which took two minutes) I have cached menus and pages working flawlessly. Great stuff.

I tried using your lib, I found problems, I hope that you can explain to me about it. Here is my code :



$cache = new Cache();
$time_start = microtime(true);
if(!$data = $cache->get($ID)){

$link = mysql_connect("localhost","root","");
$conn = mysql_select_db("ASF",$link);


echo "cached successful";
echo "<br /> Record : ". count($data);
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "<br />Time spent : $time seconds\n";
Here is the result
- The first time :
cached successful
Record : 40001
Time spent : 2.1360259056091 seconds

- The second time (after caching):

Record : 40001
Time spent : 4.4445600509644 seconds

I would like to suggest an improvement. If your application has to cache a huge amount of data, you can get directory problems (a lot of files in the same directory), so it's a good idea to organizate the cache files in directories, p.e.:


So, I make this change:

function _file($cache_id, $cache_group = NULL)
  $hash = md5($cache_id);
  $path = $this->_group_dir($cache_group).'/'.substr($hash, 0, 1).'/'.substr($hash, 0, 2).'/';
  @mkdir($path, 0777, true);
  return $path.$hash;

Sorry form my english Wink

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.