Issue #1860876 by pounard: Fixed module_implements_write_cache() should not drop caches when requesting with POST method.

merge-requests/26/head
David Rothstein 2013-08-05 21:32:02 -04:00
parent 2df0b841f5
commit cadd940917
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,9 @@
Drupal 7.23, xxxx-xx-xx (development version)
-----------------------
- Performance improvement: Allowed all hooks to be included in the
module_implements() cache, even those that are only invoked on HTTP POST
requests.
- Made the database system replace truncate queries with delete queries when
inside a transaction, to fix issues with PostgreSQL and other databases.
- Fixed a bug which caused nested contextual links to display improperly.

View File

@ -834,10 +834,7 @@ function module_hook_info() {
*/
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 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')) {
if (isset($implementations['#write_cache'])) {
unset($implementations['#write_cache']);
cache_set('module_implements', $implementations, 'cache_bootstrap');
}