From 0085972f1e62162b9c010237e5bd5b9b3bfccc4a Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 29 Sep 2009 18:08:28 +0000 Subject: #557542 follow-up by catch: Fixed module_implements() caching for authenticated users. --- includes/module.inc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'includes') diff --git a/includes/module.inc b/includes/module.inc index 1b6d04cf7..43bd83e1d 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -416,12 +416,10 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { */ function module_implements_write_cache() { $implementations = &drupal_static('module_implements'); - // Check whether we need to write the cache. We do not want to cache hooks, - // which are only invoked on HTTP POST requests. Maybe the page is not - // cacheable for other reasons than the HTTP request type as well, but this - // does not matter for the hook implementation cache, because nothing breaks - // if hook implementations are not cached. - if (isset($implementations['#write_cache']) && drupal_page_is_cacheable()) { + // Check whether we need to write the cache. We do not want to cache hooks + // which are only invoked on HTTP POST requests since these do not need to be + // optimized as tightly, and not doing so keeps the cache entry smaller. + if (isset($implementations['#write_cache']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD')) { unset($implementations['#write_cache']); cache_set('module_implements', $implementations); } -- cgit v1.2.3