1

I made a custom module, in which I dynamically add regions. The thing is, I want to make just the region part of the cache to refresh after. So drupal_flush_all_caches(); isn't the solution, since this takes too long, as well as it sometimes crashes the site.

Could anyone tell me which function I need to specifically clear the region/blocks cache? I tried all logical functions from the drupal_flush_all_caches(); function. I also couldn't find the right call from cache_clear_all();.

Any help would be appreciated.

2

You are looking for cache_clear_all. You want to set first argument $cid to NULL, as you want expire all your objects. Now you only need to figure second argument, $bin. For sure you have to clear cache_page bin. If it's not enough, look inside your database for cache_% tables (where % means any string, per SQL standard) to know what bins are available to you.

Last but not least, dynamic regions may be huge performance hit. Think twice if that's what you really need.

  • Any idea which cache table governs the regions? None of the cache names really give away anything about the possibility of having the regions cached inside. And it's not the page cache. Because I got about as far as you've told me already, just couldn't find out which cache contains the region information. – Sander Koedood Sep 10 '13 at 14:28
  • @SanderKoedood It's in the cache_bootstrap table with a cid of system_list – Clive Sep 10 '13 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.