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.
We're working to make all blocks cacheable. This block can trivially be made cacheable. Let's just get it done.
Comment | File | Size | Author |
---|---|---|---|
#6 | cacheable_syndicate_block-2232385-6.patch | 1.13 KB | Wim Leers |
Comments
Comment #1
Wim LeersComment #2
Wim LeersComment #3
jibranAgreed so RTBC.
Comment #4
znerol CreditAttribution: znerol commentedPerhaps this is a stupid question, but what is the performance benefit of caching this block? If I'm not mistaken this will generate an additional trip to the cache backend (which possibly might be the database), while rendering it is just a matter of feeding some static array into
drupal_render
. Has the render API really become slower than the database? Do we have benchmarks for that?Comment #5
webchickGood question.
Comment #6
Wim LeersI was in a "convert all the blocks" frenzy, but I agree. In fact, we should do precisely the opposite: prevent caching, because it's so ridiculously cheap to render. A cache get implies I/O, and I/O is always going to be more expensive than a very limited number of CPU cycles. Therefore, avoid I/O altogether.
Comment #7
Wim LeersComment #8
dawehnerReally wise observation!
Comment #9
webchickCommitted and pushed to 8.x. Thanks!
Comment #11
Wim Leers