Part of the EllisLab Network
   
2 of 2
2
Cache library
Posted: 18 July 2008 04:13 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  03-02-2008

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

 Signature 

Geshan

Profile
 
 
Posted: 17 December 2008 05:38 PM   [ Ignore ]   [ # 12 ]  
Summer Student
Total Posts:  1
Joined  07-29-2008

A very useful library, Thank you.

Profile
 
 
Posted: 17 December 2008 06:19 PM   [ Ignore ]   [ # 13 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1163
Joined  08-06-2006

this caching lib is more recent.

 Signature 

imap_pop get email | site_migrate port sites | OOCalendar | PhotoBox2 gallery | CI/EE 2 word_limiter, yep, wrote it

Profile
 
 
Posted: 11 June 2009 01:09 AM   [ Ignore ]   [ # 14 ]  
Grad Student
Rank
Total Posts:  40
Joined  12-10-2008

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

Profile
 
 
Posted: 18 September 2009 03:02 PM   [ Ignore ]   [ # 15 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  116
Joined  08-21-2009

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.

Profile
 
 
Posted: 04 November 2009 04:12 AM   [ Ignore ]   [ # 16 ]  
Summer Student
Total Posts:  1
Joined  11-04-2009

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

<?php

define(“BASEPATH”,$_SERVER[‘DOCUMENT_ROOT’].“cache_test/”);

include(“Cache.php”);
$cache = new Cache();
$ID=“1234425”;
$time_start = microtime(true);
if(!$data = $cache->get($ID)){
 
  $link = mysql_connect(“localhost”,“root”,”“);
  $conn = mysql_select_db(“ASF”,$link);
  $sSQL = “SELECT * FROM RESERVATION_SIMULATED”;
  $rs=mysql_query($sSQL);
  $count=0;
  while($row=mysql_fetch_array($rs)){
      $data[]=$row;
      $count++;
     
      if($count>40000){
        break;
      }
     
  }
  $cache->save($ID,$data);
  echo “cached successful”;
}
echo “
Record : “. count($data);
$time_end = microtime(true);
$time = $time_end - $time_start;
echo “
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

Profile
 
 
   
2 of 2
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120509 Total Logged-in Users: 32
Total Topics: 126576 Total Anonymous Users: 6
Total Replies: 665464 Total Guests: 376
Total Posts: 792040    
Members ( View Memberlist )