Closed (fixed)
Project:
Block Cache Alter
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2011 at 17:56 UTC
Updated:
25 Jul 2011 at 20:41 UTC
I've configured most of my blocks to be cached, which has greatly reduced the number of queries per page. However, Block Cache Alter is querying the database for every block and checking its cache status.
The attached patch modifies Block Cache Alter to ping the database once per request, storing the block configuration in a static variable, which only takes one database request.
This could be further optimized to store the block cache configuration in the cache table using cache_set() and cache_get(), which, if using Memcache would make it even faster.
| Comment | File | Size | Author |
|---|---|---|---|
| statically-cache-blocks.patch | 970 bytes | joelstein |
Comments
Comment #1
swentel commentedCan live with the patch, although I can imagine this won't have a big impact on most users which probably just change the cache setting of a block and don't call the block themselves in code. Still, like the patch, committed and pushed, thanks!