FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Cache troubles for guests
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Cache troubles for guests [message #24879] Wed, 18 May 2005 07:23 Go to next message
akie is currently offline  akie   Russian Federation
Messages: 12
Registered: March 2005
Location: Russia
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user

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 09:47 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 #24888 is a reply to message #24881] Wed, 18 May 2005 09:55 Go to previous messageGo to next message
akie is currently offline  akie   Russian Federation
Messages: 12
Registered: March 2005
Location: Russia
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user

Yes.

Why only for registered?!
Re: Cache troubles for guests [message #24890 is a reply to message #24888] Wed, 18 May 2005 10:00 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: bad importing usenet news, FROM: header
Next Topic: Template tree view
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Oct 23 02:25:45 EDT 2017

Total time taken to generate the page: 0.00675 seconds