<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Ah, what a slap-in-the-forhead-moment :) Thank you.</div><div><br></div><div>On a side note, and in regards to my original secon question about best practice:</div><div>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?</div><div><br></div><div>-fredrik</div><div><br><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(127, 127, 127, 1.0);"><b>Fra: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Randy Fay <<a href="mailto:randy@randyfay.com">randy@randyfay.com</a>></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(127, 127, 127, 1.0);"><b>Emne: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Re: [development] Block caching in D7</b></span></div><br>Hi Fredrik - <br><br>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:<br><br><span style="font-family: courier new,monospace;">function _block_get_cache_id($block) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> global $user;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> // User 1 being out of the regular 'roles define permissions' schema,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> // it brings too many chances of having unwanted output get in the cache</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> // and later be served to other users. We therefore exclude user 1 from</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> // block caching.</span><br><br>My testing (after I logged in as a different user) did show caching work correctly, at least in casual testing.<br><br>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 (<a href="http://drupal.org/project/examples">http://drupal.org/project/examples</a>) so that one can easily explore whether caching is happening or not. When <a href="http://drupal.org/node/995316">http://drupal.org/node/995316</a> goes in (maybe tonight) it will make an easier way to explore block caching.<br>
<br>-Randy</blockquote></div></body></html>