Prevent caching of a specific block

edited October 2012 in Modules
Hello,

I was wondering if it's possible to exclude part of a template from being cached.
For example I would like to display information related to user's geographical location so it need to be different for every user even if they are not logged-in.

Is there some Dwoo annotation I can surround the code with for it to be run each time the page is rendered?
Or maybe create a FUEL block and prevent caching just for this block?
Any other thoughts?

Thanks!

Comments

  • edited 7:09PM
    This is a page created in the CMS correct? If so, I would turn off page caching for that page in the CMS (select "no" for the published radio button). If there are parts of the page you do need to cache, you can use the Cache library object to do that.

    Another option is to use AJAX to pull in content.

    Although you can cache Dwoo templates as well, it is turned off by default. What you see in the cache/dwoo/compiled folder is the compiled templates which have compiled executable PHP code in them.
  • edited 7:09PM
    It's actually part of my header block so it displays on each page.
    But it's a shame to disable caching on each page since the content of those pages is very cachable.
    I'm gonna look into the ajax solution then.
    Thanks!
Sign In or Register to comment.