Cache troubles for guests [message #24879] |
Wed, 18 May 2005 11:23 |
akie
Messages: 12 Registered: March 2005 Location: Russia
Karma: 0
|
Junior Member |
|
|
I think the following code is not clear:
(./inc/include/theme/default/users.inc)
...
if (!($u = ses_get())) {
/* new anon user */
$u = ses_anon_make();
} else if ($u->id != 1 && (!$GLOBALS['is_post'] || sq_check(1, $u->sq, $u->id, $u->ses_id))) { /* store the last visit date for registered user */
header("Expires: Mon, 21 Jan 1980 06:01:01 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
...
It means that for anonymous account the headers mentioned above are not sent (of course, only if web-server does not it itself).
Why they are sent only for registered users?
I have had trouble with my instanse of FUDforum: guest (anonymous) could not see new messages in any forum until he makes his browser to re-request the page. Then I've moved these three lines with "header..." instructions to the beginning of 'inc/src/root_index.php.t' - and everything is ok now.
So, I suppose that it is better to move these three lines, as i did, or remove them all (in this case, cache control will be the web-server administrator's task). Overwise anyone else will have such troubles.
|
|
|
Re: Cache troubles for guests [message #24881 is a reply to message #24879] |
Wed, 18 May 2005 13:47 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
The headers you mention are the "no-cache" headers only sent to logged in members of the forum to prevent page caching.
FUDforum Core Developer
|
|
|
|
Re: Cache troubles for guests [message #24890 is a reply to message #24888] |
Wed, 18 May 2005 14:00 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Because for anymous we can actualy allow browser to cache pages without consequences. For registered users we need to ensure constant refreshing of sequence & session values that may pass via URLs & FORMs
FUDforum Core Developer
|
|
|