Refresh vs cache?

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
User avatar
rmang
Registered User
Posts: 285
Joined: Fri Aug 24, 2001 10:33 pm

Refresh vs cache?

Postby rmang » Tue Mar 26, 2002 9:07 pm

What does everyone think about the following:

Having either:
A. Each of the forums/messages being cached so that when using the browser's "back" button you can go to the forum without it having to reload the page.
-OR-
B. Having each forum/message never cached so if you use the back button it reloads that page every time.

I am just trying to see the impact of each method as far as usability, bandwidth usage, etc... I personally like dynamic boards where the forum can be cached for quick flipping back and forth to catch up and read posts.

I am not trying to insinuate a feature request or coding change, just seeing how others like to use the board to best determine how to setup multiple boards for many clients. The hard part is making the code work for all users without proxy issues, etc... :)

Rob M.

User avatar
Teach
Registered User
Posts: 305
Joined: Wed Nov 28, 2001 6:58 am
Location: Hopefully, soon to be somewhere else

Postby Teach » Wed Mar 27, 2002 3:16 am

Of those two choices, I would choose A, because it makes the whole forum browsing experience faster and more enjoyable for users. IMHO, there's not much point to having <1 second page creation times if users still have to wait up to several seconds for the entire forum page to reload from the server after each time they read a message.

User avatar
madenglishbloke
Registered User
Posts: 11
Joined: Wed Mar 20, 2002 12:03 am
Location: Manchester, UK

Postby madenglishbloke » Wed Mar 27, 2002 8:07 am

i have to agree - cache the page, so you can speed through them - THEN do an manual refresh so you catch all the posts that have gone up since you started.

mad

dodgy
Registered User
Posts: 47
Joined: Thu Feb 14, 2002 10:24 am

Postby dodgy » Wed Mar 27, 2002 8:58 am

With RC-4 it changed .. it used to be that pressing 'back' would read from the cache and show you the posts you'd already read as 'new'.

Now with RC-4 it always reloads the page giving you an up to date picture.

Was this an intentional design descision - can we reverse it with an option?

Thanks

Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Postby Nathan_Anderson » Wed Mar 27, 2002 11:27 pm

The reason it has changed was to fix an AOL / Proxy problem. I have been testing the following modified line and it seems to work better.

Go to around line 530 in the includes/page_header.php file and replace the "Header("Cache-Control:...." with this one.

---- Remember this effects how the clients & proxies cache the files -----

header ("Cache-Control: private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0");

----- Change at your own risk. -----


It does appear to be caching the files properly for me, and also appears to be working with AOL.

However, if you want to disable the cache-elimination all together (like RC2/RC3) I believe you would want the following line instead:

header ("Cache-Control: private");

This should still allow it to do what RC2/3 was doing, but also work with AOL / Proxies.

Nathan.

User avatar
rmang
Registered User
Posts: 285
Joined: Fri Aug 24, 2001 10:33 pm

Postby rmang » Wed Mar 27, 2002 11:35 pm

Nathan:

You may have hit the nail on the head!! The line:

Code: Select all

header ("Cache-Control: private");

to replace the
header ("Cache-Control:...");
line seems to work very nicely to allow my browser to cache on using the back button, but reload a page if I click a link.

If we can get some proxy/AOL testing on a board using just the private Cache-Control, this could be a viable option to make the boards faster to browse. :)

Rob M.

User avatar
rmang
Registered User
Posts: 285
Joined: Fri Aug 24, 2001 10:33 pm

Postby rmang » Fri Mar 29, 2002 3:31 am

Anybody else try this suggestion behind a proxy to see if it causes any problems with the board? :) Have had it on my test forum without any problems so far.

Rob M.

User avatar
Teach
Registered User
Posts: 305
Joined: Wed Nov 28, 2001 6:58 am
Location: Hopefully, soon to be somewhere else

Postby Teach » Fri Mar 29, 2002 4:45 am

Do we know for sure why the RC2/RC3 cache behavior was changed in RC4?

Was it because:

1. They wanted the search page to repeatedly reload from the server after each message was read, to make sure it had the latest search results.

2. AOL users had caching problems with the RC2/RC3 cache setup.

If it was changed just for Reason 1, and not because of any problems, then I'd love to set my forums back to RC2/RC3's

("Cache-Control: private");

Berend
Registered User
Posts: 285
Joined: Tue Nov 20, 2001 4:44 pm
Location: NL

Postby Berend » Sat Mar 30, 2002 10:39 am

I changed my code to

Code: Select all

header ("Cache-Control: private");

but
line seems to work very nicely to allow my browser to cache on using the back button, but reload a page if I click a link.
This doen`t work for my indexpage. Does it work for u guys?

User avatar
Teach
Registered User
Posts: 305
Joined: Wed Nov 28, 2001 6:58 am
Location: Hopefully, soon to be somewhere else

Postby Teach » Sat Mar 30, 2002 1:38 pm

Berend wrote:I changed my code to

Code: Select all

header ("Cache-Control: private");

but
line seems to work very nicely to allow my browser to cache on using the back button, but reload a page if I click a link.
This doen`t work for my indexpage. Does it work for u guys?

I changed my RC-4 code the same way and it's currently working for all of my pages, with IE5.5 and no proxy.

Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Postby Nathan_Anderson » Sun Mar 31, 2002 6:19 am

The "Cache-Control: private" was my own idea after reading the RFC's on caching. None of the PHPBB RC's used that line. (or used private)

RC3 used :

Code: Select all

header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: pre-check=0, post-check=0, max-age=0", false);


RC4: the line has been merged together to be:

Code: Select all

header ("Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0");
.

What was happening was that if you had the latest version of PHP on your server then you would get the equivlent of RC4 on RC3. However most of the versions of PHP didn't support the duplicating headers (i.e. Two Cache-Control headers) and you would only get the second header line.

If you want to go back to the way RC3, then just use this line:

Code: Select all

header ("Cache-Control: pre-check=0, post-check=0, max-age=0");


However that line does NOT work through AOL proxies. They (AOL'rs) will not be able to use the board if your board uses cookies.

So if you like the way RC3 worked but you do want it to work through AOL proxies use this line:

Code: Select all

header ("Cache-Control: private, pre-check=0, post-check=0, max-age=0");


Again, this has not been extensively tested. It may cause other problems with other proxies.

I currently use the following line as I think it works the best. But it would be good to get feedback on if the line above vs the line below works better.

Code: Select all

header ("Cache-Control: private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0");


Nathan.

User avatar
rmang
Registered User
Posts: 285
Joined: Fri Aug 24, 2001 10:33 pm

Postby rmang » Sun Mar 31, 2002 2:16 pm

Here is my feedback:

With this line:

Code: Select all

header ("Cache-Control: private");

I get all pages being cached when using the back button, and clicking on any link refreshes that page. This seems to be the proper way for the board to work IMHO.

With this line:

Code: Select all

header ("Cache-Control: private, pre-check=0, post-check=0, max-age=0");

I get the same results as just using the private line above, ie proper caching of all pages with links working to refresh the page.

With this line:

Code: Select all

header ("Cache-Control: private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0");

No pages will cache for me, and using the back button requires any page to be reloaded, which means I lose search results, text boxes, etc...

Tested with ie 5.5, ie 6.0, and no proxy. A few aolers tested the 1st two lines and did not experience any problems. However, this is a very limited test, not too large in scope.

Rob M.

User avatar
psoTFX
Former Team Member
Posts: 7425
Joined: Tue Jul 03, 2001 8:50 pm

Postby psoTFX » Sun Mar 31, 2002 2:22 pm

Well, this board is now running "private, pre-check=0, post-check=0, max-age=0" ... feedback welcome.

User avatar
Deathscythe
Registered User
Posts: 58
Joined: Wed Nov 28, 2001 11:28 pm
Location: 127.0.0.1
Contact:

Postby Deathscythe » Sun Mar 31, 2002 10:43 pm

I prefer it to reload all the time.

Berend
Registered User
Posts: 285
Joined: Tue Nov 20, 2001 4:44 pm
Location: NL

Postby Berend » Sun Mar 31, 2002 11:05 pm

I have this now:

Code: Select all

header ("Cache-Control: pre-check=0, post-check=0, max-age=0");
Also tried standard RC-4. Users are complaining that the folder go grey, even with unread posts. Is this problem related to the cache?


Return to “2.0.x Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests