On a fresh install, content within a block is not updating for the Anonymous User without the Cache Setting being fully disabled.

I have the following conditions:

1) In Administer >> Settings >> Cache Settings
Page Cache: Enabled
Minimum cache lifetime: 5 min

2) Theme: bluemarine

3) A block in the "content area" on the front page enabled with php code for a server side include

The effect:

Content within the block will update for signed in member (as expected), but would not update for the anonymous user during a 36 hour test period. Multiple attempts to refresh the content through Firefox 1.5 and IE 6 at two different Internet locations (one home through ISP and the the other through work) failed.

When the following was changed:

Page Cache: Disabled

The effect:

The content within the block enabled for both signed in both for authenticated user and anonymous user (as expected).

Comments

killes@www.drop.org’s picture

Version: 4.7.0-beta3 » x.y.z
Status: Active » Closed (works as designed)

Well, this is pretty much by design. I am not saying that the design is good, though. :p

What you can do is to invalidate the cache through the module that produces the block after a change that affects the block has been made.

bryansd’s picture

killes,

I would assume invalidating the cache would be done through the API and making the call within the block? If so, which call would I make?

I won't argue too much whether "by design" this is a good thing or not. But, one would think that after the Minimum cache lifetime had expired, the content in the block would update for the anonymous user. I certainly can't be the only one that thinks this way? What is the point of defining a cache lifetime, if there is no clearing of the cache for all of the contents in the page? At the very least, should there not then be a "max cache lifetime" on the cache settings page for selection?

killes@www.drop.org’s picture

cache_clear_all() would be what you need to call. You could maybe do that from a cron hook. I am contemplating adding this to the event module. The minimum cache lifetime is the _minum_ time a cache entry will be alive. Not the maximum. The cache is only invalidated if there is a content change on the site (new node or comment).