You can use the sfProcessCache

Example:
http://www.symfony-project.com/snippets/snippet/110

greetings
Gimler


-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von 
Greg Militello
Gesendet: Dienstag, 16. Januar 2007 21:09
An: symfony developers
Betreff: [symfony-devs] Data caching?


Hello all,

I've been looking for a good way to handle this, and it appear (at least to me) that symfony does not allow caching of data.

For example I find myself retrieving a data set that I can cache, but either session variables or request parameters impact what gets displayed.

I was thinking an interface to do this would be very easy, just offer something along these lines:

<?php

$cache = new sfDataCache ();

if (!$cache->retrieve('myDataCacheKey'))
{
  $c = new Criteria();
  $myData = MyPeer::doSelect($c);

  $cache->set('myDataCacheKey', $myData);
}

$myData = $cache->retrieve('myDataCacheKey');

?>

I am thinking the set method would have optional parameters for setting things like cache duration, or flat file storage path. Also possibly a method to "unset" a cache key.


        Did I miss something like this in symfony?
        

-Greg



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "symfony 
developers" 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/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to