Nope, nothing happened.

I have a folder inside cache called long and its empty. Noting saved to it.

Any other ideas?

$state_cache = Cache::read('state_cache', 'long');
                          if ($state_cache !== false) 
                          
                          {
                                  $state_cache = $this->getStates();
                                  Cache::write('state_cache', $state_cache,
'long');
                          }

Thanks,

Dave 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Pablo Viojo
Sent: January-09-10 8:07 PM
To: [email protected]
Subject: Re: New to Cache

Try passing the config as third param when writing and second when reading:

Cache::write('state_cache', $state_cache, 'long');

Cache::read('state_cache',  'long');

HTH!

Regards,

Pablo Viojo
[email protected]
http://pviojo.net

¿Que necesitas?
http://www.needish.com



On Sat, Jan 9, 2010 at 8:20 PM, Dave <[email protected]> wrote:


        This is my first attempt at caching a model find() and was hoping
for a
        little info.
        
        Cache::write('state_cache', $state_cache);
        
        So I check server cache folder and see a file called
cake_state_cache which
        contains:
        
        1263079575
        
{i:15;s:7:"Alabama";i:14;s:6:"Alaska";i:17;s:7:"Arizona";i:16;s:8:"Arkansas"
        
;i:18;s:10:"California";i:19;s:8:"Colorado";i:20;s:11:"Connecticut";i:22;s:8
        :"Delaware";i:21;s:20:"District of
        
Columbia";i:23;s:7:"Florida";i:24;s:7:"Georgia";i:25;s:6:"Hawaii";i:27;s:5:"
        
Idaho";i:28;s:8:"Illinois";i:29;s:7:"Indiana";i:26;s:4:"Iowa";i:30;s:6:"Kans
        
as";i:31;s:8:"Kentucky";i:32;s:9:"Louisiana";i:35;s:5:"Maine";i:34;s:8:"Mary
        
land";i:33;s:13:"Massachusetts";i:36;s:8:"Michigan";i:37;s:9:"Minnesota";i:3
        
9;s:11:"Mississippi";i:38;s:8:"Missouri";i:40;s:7:"Montana";i:43;s:8:"Nebras
        ka";i:47;s:6:"Nevada";i:44;s:13:"New Hampshire";i:45;s:10:"New
        Jersey";i:46;s:10:"New Mexico";i:48;s:8:"New York";i:41;s:14:"North
        Carolina";i:42;s:12:"North
        
Dakota";i:49;s:4:"Ohio";i:50;s:8:"Oklahoma";i:51;s:6:"Oregon";i:52;s:12:"Pen
        nsylvania";i:53;s:12:"Rhode Island";i:54;s:14:"South
        Carolina";i:55;s:12:"South
        
Dakota";i:56;s:9:"Tennessee";i:57;s:5:"Texas";i:58;s:4:"Utah";i:61;s:7:"Verm
        ont";i:60;s:14:"Virgin
        Islands";i:59;s:8:"Virginia";i:62;s:10:"Washington";i:64;s:13:"West
        
Virginia";i:63;s:9:"Wisconsin";i:65;s:7:"Wyoming";i:1;s:7:"Alberta";i:2;s:16
        :"British Columbia";i:3;s:8:"Manitoba";i:4;s:13:"New
        Brunswick";i:5;s:25:"Newfoundland and Labrador";i:7;s:21:"Northwest
        Territories";i:6;s:11:"Nova
        Scotia";i:8;s:7:"Nunavut";i:9;s:7:"Ontario";i:10;s:20:"Prince Edward
        
Island";i:11;s:6:"Quebec";i:12;s:13:"Saskatachewan";i:13;s:5:"Yukon";}
        
        Ok so that's good.
        
        In my config.php I coped straight from the cookbook:
        
        Cache::config('short', array(
           'engine' => 'File',
           'duration'=> '+1 hours',
           'path' => CACHE,
           'prefix' => 'cake_short_'
        ));
        
        // long
        Cache::config('long', array(
           'engine' => 'File',
           'duration'=> '+1 week',
           'probability'=> 100,
           'path' => CACHE . 'long' . DS,
        ));
        
        How do I determin where I save my state_cache? My guess is we wont
see any
        new States or Provinces in out lifetime so I would like to cache
that for a
        good amount of time..1 week for long right now is good enough just
to get me
        going.
        
        I guess I am missing something in the Cache::write('state_cache',
        $state_cache); prefix? Path?
        
        Thanks,
        Dave
        
        
        Check out the new CakePHP Questions site http://cakeqs.org and help
others with their CakePHP related questions.
        
        You received this message because you are subscribed to the Google
Groups "CakePHP" group.
        To post to this group, send email to [email protected]
        To unsubscribe from this group, send email to
        [email protected]
<mailto:cake-php%[email protected]>  For more options, visit
this group at http://groups.google.com/group/cake-php?hl=en
        
        


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/09/10
16:05:00



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to