Running cron apparently does not clear the cache tables: http://drupal.org/node/315303
Is there any time period when caches are automatically rebuilt? I googled and can't find an answer to this seemingly-simple question.
Thanks.
Fred Jones wrote:
Running cron apparently does not clear the cache tables: http://drupal.org/node/315303
Is there any time period when caches are automatically rebuilt? I googled and can't find an answer to this seemingly-simple question.
Thanks.
Your question is vague. There are different types of "caches". Those that are true "caches" have an expiration field that control the rebuild of the cached data. If you mean the menu, well, it really isn't a cache even though it's rebuild is triggered by the "Clear cached data" button. The menu router data doesn't change unless you add a new module. The custom menu is handled slightly differently than the menus coming from modules but still the menu router doesn't change once you've set the menu.
Why do you ask? Are you developing code and not seeing the caches change or is there some production issue you need resolved?
Some links that will help you understand Caching and performance in Drupal.
http://www.lullabot.com/articles/a_beginners_guide_to_caching_data http://drupal.org/node/326504
Shyamala -----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Earnie Boyd Sent: Tuesday, April 20, 2010 3:36 AM To: support@drupal.org Subject: Re: [support] When are Caches Cleared?
Fred Jones wrote:
Running cron apparently does not clear the cache tables: http://drupal.org/node/315303
Is there any time period when caches are automatically rebuilt? I googled and can't find an answer to this seemingly-simple question.
Thanks.
Your question is vague. There are different types of "caches". Those that are true "caches" have an expiration field that control the rebuild of the cached data. If you mean the menu, well, it really isn't a cache even though it's rebuild is triggered by the "Clear cached data" button. The menu router data doesn't change unless you add a new module. The custom menu is handled slightly differently than the menus coming from modules but still the menu router doesn't change once you've set the menu.
Why do you ask? Are you developing code and not seeing the caches change or is there some production issue you need resolved?
http://www.lullabot.com/articles/a_beginners_guide_to_caching_data http://drupal.org/node/326504
Yes, I've seen these but I still haven't found the answer. Perhaps I have found it, by default.
Your question is vague.
Right--my mistake.
Why do you ask? Are you developing code and not seeing the caches change or is there some production issue you need resolved?
The issue is that a client called me to ask why an event that he cancelled and thus unpublished was still appearing on this months' calendar page. He had even deduced that this was a problem only for anonymous users. So I cleared the page cache and it was fixed.
Then he asked me, "So what, every time we make a change we have to know to clear the cache??"
I haven't seen anywhere that page caches are rebuilt automatically ever so I'm guessing that maybe they're not. Ever?
That's the question.
Thanks.
Fred Jones wrote:
Why do you ask? Are you developing code and not seeing the caches change or is there some production issue you need resolved?
The issue is that a client called me to ask why an event that he cancelled and thus unpublished was still appearing on this months' calendar page. He had even deduced that this was a problem only for anonymous users. So I cleared the page cache and it was fixed.
The pages are cached for anonymous users for performance. The caches have a timeout value and should rebuild after they expire. If you go to /admin/settings/performance, what do you have the minimum cache lifetime set to?
Then he asked me, "So what, every time we make a change we have to know to clear the cache??"
I think you just need to adjust the minimum cache lifetime. Otherwise a custom module with it's own cron hook could reset it for you.
I haven't seen anywhere that page caches are rebuilt automatically ever so I'm guessing that maybe they're not. Ever?
They should be after the cache expires.
That's the question.
And that's my answer. ;p
Thanks.
HTH,
There is no automatic rebuild for page cache that has expired. The cache will stay until 1. anonymous user browse to that particular page, or 2. cache_clear_all() is called
# Hendry
On Tue, Apr 20, 2010 at 5:49 PM, Fred Jones fredthejonester@gmail.com wrote:
I haven't seen anywhere that page caches are rebuilt automatically ever so I'm guessing that maybe they're not. Ever?
That's the question.
Thanks.
The pages are cached for anonymous users for performance. The caches have a timeout value and should rebuild after they expire. If you go to /admin/settings/performance, what do you have the minimum cache lifetime set to?
That's the minimum. I am asking about the maximum.
There is no automatic rebuild for page cache that has expired. The cache will stay until
- anonymous user browse to that particular page, or
- cache_clear_all() is called
Question is when does it expire? I see there is a minimum and mine is set to NONE. I *think* what I am asking is about the maximum.
F
Fred Jones wrote:
Question is when does it expire? I see there is a minimum and mine is set to NONE. I *think* what I am asking is about the maximum.
That would depend on the "cache_flush_$table" variable and the cache_lifetime variable and whether or not the cache is deemed CACHE_PERMANENT (a.k.a. expire == 0). See http://api.drupal.org/api/function/cache_get/6 for more information. CACHE_PERMANENT should only be used for things like variables data and the theme_registry. 'cache_lifetime' is the variable for the minimum.
Tracing through it, maybe there is a bug but I don't know it to be. I am sure that if "cache_flush_$table" isn't set that the cache will never be deleted unless cache_clear_all is called with a "wildcard".
Question is when does it expire? I see there is a minimum and mine is set to NONE. I *think* what I am asking is about the maximum.
That would depend on the "cache_flush_$table" variable and the cache_lifetime variable and whether or not the cache is deemed CACHE_PERMANENT (a.k.a. expire == 0). See http://api.drupal.org/api/function/cache_get/6 for more information. CACHE_PERMANENT should only be used for things like variables data and the theme_registry. 'cache_lifetime' is the variable for the minimum.
Tracing through it, maybe there is a bug but I don't know it to be. I am sure that if "cache_flush_$table" isn't set that the cache will never be deleted unless cache_clear_all is called with a "wildcard".
Yes, that's how it appears. The only DELETE I see there is inside of:
if ($cache_flush &&
and I checked my site and it has no cache_flush_* entries in the variable table. I checked a few sites actually and none of them appear to have that.
So are we back to my sneaking suspicion that a 'regular' site has no maximum expiration for cache? Seems that's what you wrote above also.
Thanks.
Fred Jones wrote:
Question is when does it expire? I see there is a minimum and mine is set to NONE. I *think* what I am asking is about the maximum.
That would depend on the "cache_flush_$table" variable and the cache_lifetime variable and whether or not the cache is deemed CACHE_PERMANENT (a.k.a. expire == 0). See http://api.drupal.org/api/function/cache_get/6 for more information. CACHE_PERMANENT should only be used for things like variables data and the theme_registry. 'cache_lifetime' is the variable for the minimum.
Tracing through it, maybe there is a bug but I don't know it to be. I am sure that if "cache_flush_$table" isn't set that the cache will never be deleted unless cache_clear_all is called with a "wildcard".
Yes, that's how it appears. The only DELETE I see there is inside of:
if ($cache_flush&&
and I checked my site and it has no cache_flush_* entries in the variable table. I checked a few sites actually and none of them appear to have that.
So are we back to my sneaking suspicion that a 'regular' site has no maximum expiration for cache? Seems that's what you wrote above also.
But it could be the result of the module you use to provide the schedule. Is it calling the cache_clear_all() function? The node_save function does.
But it could be the result of the module you use to provide the schedule. Is it calling the cache_clear_all() function? The node_save function does.
No there's not even a module involved. The complaint from the client was that he unpublished a node but he still saw that on his calendar page. That calendar page is a View. When we cleared the cache, then the event disappeared from the calendar page.
Thanks, Fred
Fred Jones wrote:
But it could be the result of the module you use to provide the schedule. Is it calling the cache_clear_all() function? The node_save function does.
No there's not even a module involved. The complaint from the client was that he unpublished a node but he still saw that on his calendar page. That calendar page is a View. When we cleared the cache, then the event disappeared from the calendar page.
Ah, well, there is a module involved then, it is Views. And if I recall correctly it has its own caches.
But it could be the result of the module you use to provide the schedule. Is it calling the cache_clear_all() function? The node_save function does.
No there's not even a module involved. The complaint from the client was that he unpublished a node but he still saw that on his calendar page. That calendar page is a View. When we cleared the cache, then the event disappeared from the calendar page.
Ah, well, there is a module involved then, it is Views. And if I recall correctly it has its own caches.
Right. I thought you meant a custom module, heh heh.
OK, thanks for your assistance with this.
Fred