I need to exclude pages from cache even for anonymous users. I found cacheexclude module. It just $GLOBALS['conf']['cache'] = FALSE; but it does it in hook_init and it doesn`t set any weight during install.
I would like someone confirm my hypothesis.
It does it in init... since it has to be called for each request. It doesn`t set any weight because content will be cached once every hook had a chance to fire and header will be sent contextually.
So if I just want to switch cache off on a "menu item base" I just have to $GLOBALS['conf']['cache'] = FALSE; in the function callback.
right?
http://drupal.org/project/cacheexclude
:-)
On Friday 08 May 2009 12:52:30 am Ivan Sergio Borgonovo wrote:
I need to exclude pages from cache even for anonymous users. I found cacheexclude module. It just $GLOBALS['conf']['cache'] = FALSE; but it does it in hook_init and it doesn`t set any weight during install.
I would like someone confirm my hypothesis.
It does it in init... since it has to be called for each request. It doesn`t set any weight because content will be cached once every hook had a chance to fire and header will be sent contextually.
So if I just want to switch cache off on a "menu item base" I just have to $GLOBALS['conf']['cache'] = FALSE; in the function callback.
right?
On Fri, 8 May 2009 01:08:53 -0500 Larry Garfield larry@garfieldtech.com wrote:
http://drupal.org/project/cacheexclude
:-)
On Friday 08 May 2009 12:52:30 am Ivan Sergio Borgonovo wrote:
I need to exclude pages from cache even for anonymous users. I found cacheexclude module.
^^^^^^^^^^^^
It is Friday for everyone... ;)
I was wondering why it is doing it that way so I could replicate the functionality in my code without missing any details.
thanks
It just $GLOBALS['conf']['cache'] = FALSE; but it does it in hook_init and it doesn`t set any weight during install.
I would like someone confirm my hypothesis.
It does it in init... since it has to be called for each request. It doesn`t set any weight because content will be cached once every hook had a chance to fire and header will be sent contextually.
So if I just want to switch cache off on a "menu item base" I just have to $GLOBALS['conf']['cache'] = FALSE; in the function callback.
right?
On Friday 08 May 2009 2:27:32 am Ivan Sergio Borgonovo wrote:
On Fri, 8 May 2009 01:08:53 -0500
Larry Garfield larry@garfieldtech.com wrote:
http://drupal.org/project/cacheexclude
:-)
On Friday 08 May 2009 12:52:30 am Ivan Sergio Borgonovo wrote:
I need to exclude pages from cache even for anonymous users. I found cacheexclude module.
^^^^^^^^^^^^It is Friday for everyone... ;)
I was wondering why it is doing it that way so I could replicate the functionality in my code without missing any details.
thanks
... Sigh.
That variable is what controls the "cache this page" logic that happens at the END of the page request. So if a page is already cached, it will still get sent. (That happens before any hooks run.) However, if the page is not cached and that variable is set to false then at the end of the page request it will not be cached, and therefore the next page request will regenerate it again. It's useful mostly for pages that contain dynamic "Randomize on every page view" content.
I don't know what "menu item base" means, but yes you can set that variable to false pretty much anywhere and it should behave as described above. CacheExclude is just a simple UI to forcing that value off.