Ok...thanks Nickolas... But does this work for actions? I basically don't want that action and corresponding MySQL calls to get executed...templates would a relatively lighter part...
The Symfony 1.0 documentation shows that if we send and argument to an action, we can cache it... like http://myapp.example.com/user/show/id/12 (on - http://www.symfony-project.org/book/1_0/12-Caching) So, how do I change the request parameter I am sending to an argument to action? :| On Dec 9, 8:48 pm, "Nickolas Daskalou" <[EMAIL PROTECTED]> wrote: > By the way, you will need to have the cache enabled in your > apps/appname/config/settings.yml file for the desired environment. > > 2008/12/10 Nickolas Daskalou <[EMAIL PROTECTED]> > > > I'm not sure if this is the case with sf 1.0, but in 1.1 and 1.2 you can do > > something like the following in one of your templates: > > > <?php > > > // The $cache_key can be in any format you want really. > > $cache_key = 'paramX='.$paramX.' :: paramY='.$paramY; > > > // How long to cache the data for, in seconds. > > $cache_lifetime = 600; // 600 = 10 minutes > > > if (!cache($cache_key, $cache_lifetime)) > > { > > ?> > > > <div> > > Blah blah blah...<?php echo $paramX; ?> blind mice and <?php echo $paramY; > > ?> glasses of milk. > > </div> > > > <?php > > cache_save(); > > } > > > Does that help you? > > > 2008/12/10 Sumedh <[EMAIL PROTECTED]> > > >> Anyone here? :| > > >> On Dec 8, 5:04 pm, Sumedh <[EMAIL PROTECTED]> wrote: > >> > Hi Friends, > > >> > I've an AJAX request like - > > >> >http://www.example.com/getData?paramX=100¶mY=200 > > >> > This AJAX response is rendered in a DIV in browser... > > >> > I want to cache this action for given paramX and paramY...I want to > >> > store HTML response for this URL and then send the same HTML in case > >> > the same URL is received... > > >> > I am using Symfony 1.0 ... > > >> > The documentation warns that "Actions called with a POST method or > >> > with GET parameters are not cached." but doesn't elaborate on that > >> > warning... :( > > >> > How can I achieve this? > > >> > Thanks in advance... :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
