Closed (works as designed)
Project:
Drupal core
Version:
6.1
Component:
book.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2008 at 05:59 UTC
Updated:
29 Feb 2008 at 09:44 UTC
I developed a block which depends on Drupal's new ip_address() function. It works well for authenticated users but not for anonimous.
It seams that it is global cached (even the BLOCK_NO_CACHE is set) for all anonymous visitors see the same content of that block (a country flag: their location). How the block caching for anonymous users works? How to develop a block which depends on time, ip addresses, languages to work for non-authenticated users?
Comments
Comment #1
yched commentedIs page caching enabled on your site ?
Most probably, it's not the cached *block* content that is reused for all users, but the cached *page* content...
Comment #2
he_who_shall_not_be_named commentedYep. As a conclusion such type of blocks won't work on caching enabled sites. I see.
Got it. Thank you!
Comment #3
he_who_shall_not_be_named commentedThank you for the answer.
There is a text at the 'normal caching' Normal (recommended for production sites, no side effects)
As you told me before, the normal caching overrides the block caching setting (BLOCK_NO_CACHE and for anonymous). As my opinion this is a serious side effect.
An anonymous user could see an other anonymous user's block content (could be ip, language, browser info, cookie, depends on what the developer puts on that block). This is also a security issue.
... or there is something I miss.
Comment #4
yched commentedThis is the very definition of the page cache : The same content gets served to all anonymous users.
This is explained by the help text above the cache mode radios.
This is is no way related to blocks or block caching, it also holds for the page's main content.