1

I have a bunch of sites built off the same profile, and recently noticed the pages aren't being cached. I spent some time doing the usual: looking for drupal_set_message calls, disabling all the modules that might disable page cache, as defined here. I've also dug into drupal_page_get_cache. This lead me to the database, where it turns out the cache_page table is empty.

This is clearly the source of the issue, I'm just not sure how/what is preventing the page cache. What I'd like to do is to figure out where page cache is writing to the database, and do a debug_backtrace, or just dpm from that point backward.

A) Is there a point in drupal core where cache_page is written to? B) Any other ideas for debuggings this? (please don't say disable all modules, then re-enable, we have upwards of 200 modules in place with a dozen custom module with interdependencies)

After posting this I opened my IDE and realized I had found the DrupalDatabaseCache->set method, and that the cache_page $cid is never called into that function.

1

Whether or not a page is cacheable is determined by drupal_page_is_cacheable().

Set a breakpoint there and dig into call stack / step through the conditions to determine the reason why nothing is saved to the cache_page bin.

Also take a look at drupal_page_footer() which calls into drupal_page_set_cache() in order to store the built page in the page cache.

| improve this answer | |

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.