I have same issue. I don't think <cake:nocache> is working at all.
On Wed, Feb 10, 2010 at 6:56 PM, Jeremy <[email protected]> wrote: > OK... I have a follow-up question. > > How do I prevent caching in certain cases? In the element that I am > working on, it is possible for the external service to fail. If that > happens, I trap the error and create some HTML to notify the user that > the service is unavailable. The problem is that I don't really want > to cache the error message. I'd rather that it retry and only cache > if the result was successful. > > I tried ecapsulating the error HTML in <cake:nocache>, but that does > not seem to work. Reloading the page will not cause the page to re- > attempt to render the external service results. > > I have pasted the full code to my element here: > http://bin.cakephp.org/view/11698566 > > > On Feb 10, 8:35 am, Jeremy <[email protected]> wrote: > > Yes, correct. My bad. > > > > On Feb 10, 2:51 am, majna <[email protected]> wrote: > > > > > > > > > I think it's /tmp/cache/views, not /tmp/cache/element > > > > > On Feb 10, 1:53 am, Jeremy <[email protected]> wrote: > > > > > > With some help... I figured out the problem. I was using the file > > > > cache option and although the /tmp/cache directory was writable I was > > > > missing a necessary directory. Since I was trying to cache an > element > > > > the /tmp/cache/element directory needs to exist and it must be > > > > writeable. My problem was that the element directory was missing. > > > > Once I added it... everything started working as expected. > > > > > > On Feb 9, 10:13 am, Jeremy <[email protected]> wrote: > > > > > > > Hi all. I have created an element that will interact with an > external > > > > > webservice. The webservice presents weather forecast data in XML > and > > > > > I am using my element code to parse the XML and render it on my > site. > > > > > The weather forecast service never updates their data more > frequently > > > > > than 1 hour, so I would like to cache the rendered element HTML for > 1 > > > > > hour globally for all users. Right now, each refresh of the page > than > > > > > contains this weather element code will cause a hit to the weather > > > > > forecast webservice and the XML will get reparsed even if it hasn't > > > > > changed. > > > > > > > I have tried to follow the instructions on how to turn on caching, > but > > > > > it does not seem to be working. > > > > > > > Here's what I have done so far: > > > > > 1) Turned this on in the config Configure::write('Cache.check', > > > > > true); > > > > > 2) I am calling the element with this code: <?php echo $this- > > > > > > > >element('weather', array('cache'=>array('time'=>'+1 hour'))); ?>- > Hide quoted text - > > > > > > > - Show quoted text -- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text - > > 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]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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 To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
