[development] development Digest, Vol 96, Issue 22
Fredrik Sandve Kilander
fredrik.kilander at gmail.com
Sat Dec 11 13:36:06 UTC 2010
Ah, what a slap-in-the-forhead-moment :) Thank you.
On a side note, and in regards to my original secon question about best practice:
The '#cache' property in the render array used for the block content is not necessary then, if I understand the mechanics correctly? This would only add a superfluous extra layer of caching?
-fredrik
> Fra: Randy Fay <randy at randyfay.com>
> Emne: Re: [development] Block caching in D7
>
> Hi Fredrik -
>
> I think you may have been testing as user 1. I started testing your problem and noticed the same thing and started debugging and then noticed this code:
>
> function _block_get_cache_id($block) {
> global $user;
>
> // User 1 being out of the regular 'roles define permissions' schema,
> // it brings too many chances of having unwanted output get in the cache
> // and later be served to other users. We therefore exclude user 1 from
> // block caching.
>
> My testing (after I logged in as a different user) did show caching work correctly, at least in casual testing.
>
> As a result of your note I've added a timestamp into one of the blocks provided by the Block Example module, part of the Examples project (http://drupal.org/project/examples) so that one can easily explore whether caching is happening or not. When http://drupal.org/node/995316 goes in (maybe tonight) it will make an easier way to explore block caching.
>
> -Randy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20101211/141cb8fb/attachment.html
More information about the development
mailing list