Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Forum blocks have bad performance but in D7+ we added forum_index that wouldn't case any performance issue anymore. remove the cache to get the blocks content always up-to-date.
it will be more better performance after this issue committed: #1354726: Add more indexes on {forum_index}
mysql> EXPLAIN SELECT SQL_NO_CACHE f.* FROM forum_index f ORDER BY f.last_comment_timestamp DESC LIMIT 5 OFFSET 0\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: f
type: index
possible_keys: NULL
key: last_comment_timestamp
key_len: 4
ref: NULL
rows: 5
Extra:
1 row in set (0.00 sec)
Comment | File | Size | Author |
---|---|---|---|
forum_block_cache.patch | 1.42 KB | droplet | |
Comments
Comment #0.0
droplet CreditAttribution: droplet commentedUpdated issue summary.
Comment #0.1
droplet CreditAttribution: droplet commentedUpdated issue summary.
Comment #1
larowlanThe caching is for when a node access module rewrites the query
Comment #2
droplet CreditAttribution: droplet commented@larowlan,
can you explain it in more details. Thanks.
EDIT:
patch above is totally remove the caches, anything I missed.
Comment #3
droplet CreditAttribution: droplet commentedComment #4
larowlanHey droplet, you are correct - core forum does not need the caching with that index but the query has a node access tag and hence node access modules (eg forum access, acl and many others) may rewrite the query, turning our inexpensive core query into a more expensive one. In these circumstances query caching is needed - that's why the block is cached by query. I guess we could add a wrapper to the caching and a config option but that seems like overkill. Marking as postponed while we explore the merits of such an approach.
Lee
Comment #4.0
larowlanUpdated issue summary.
Comment #5
droplet CreditAttribution: droplet commentedComment #17
smustgrave CreditAttribution: smustgrave at Mobomo commentedMoving this to closed outdated as this hasn't had a follow up since moving into PNMI 11 years ago.
If you feel it's still an issue please reopen with an updated issue summary and steps for where you are seeing it