Forum OpenACS Q&A: Caching of OpenACS Web Pages by ISPs

I am hosting several OpenACS based website for my customers. Visitors access these websites, using http (and not https). I have noticed that some service providers cache pages from these websites. This causes problems when a first time visitor visits one of these sites, and sees the logon name of another (previous) visitor, who has logged onto the website. The ISPs seem to be caching these dynamically generated pages.

I have included the following set of meta keywords in each page, indicating that this page should not be cached.
  <meta http-equiv="Expires"      content="Tue, 01 Jan 1980 1:00:00 GMT">
  <meta http-equiv="Pragma"        content="no-cache">
  <meta http-equiv="Cache-Control" content="no-cache">

I have also tried:
<meta http-equiv="Expires"      content="-1">
<meta http-equiv="Expires"      content="0">

However, these ISPs still cache these pages.

Is there anything that I can do that will tell an ISP's cache server not to cache the page?

I have noticed that if I place a ? in the URL, then the proxy server does not seem to cache the page. Would there be an easy way of the OpenACS server automatically including this as part of the URL?

TIA
Geert

Collapse
Posted by Sebastiano Pilla on
Have you tried contacting the ISPs in question? After all, it would seem that is *their* service to be broken, not your website, and you shouldn't fix something you didn't break.
Collapse
Posted by Geert De Witte on
I have contacted some of these ISPs. I have had difficulties convincing most of them that they are probably caching the pages incorrectly.

I am hoping there is a solution that I can implement that will fix the problem, and that I won't be reliant on an ISP configuring their caching server properly. I may be overly optimistic.

Collapse
Posted by Jun Yamog on
The ISP might be running MS Proxy. We have encountered this problem before, check an old discussion here:

https://openacs.org/forums/message-view?message_id=27295

Collapse
Posted by Geert De Witte on
Thanks to all that have provided advice on this topic.

Just to complete the thread, I'll just give feedback on the solution that we settled on.

We are running OpenACS 4.6.3 on the affected sites. We initially added the following statements to default-master.tcl to prevent the caching of pages:

ns_set put $headers "Expires" "Tue, 01 Jan 1980 1:00:00 GMT"
ns_set put $headers "Pragma" "no-cache"
ns_set put $headers "Cache-Control" "private"

This worked fine for all pages that used the default-master, but static pages and admin page eg. Ecommerce admin pages, don't use this template and were not being cached as we wished.

We then moved these statements to to the rp_handler procedure in packages/acs-tcl/tcl/request-processor-procs.tcl:
set headers [ad_conn outputheaders]
ns_set put $headers "Expires" "Tue, 01 Jan 1980 1:00:00 GMT"
ns_set put $headers "Pragma" "no-cache"
ns_set put $headers "Cache-Control" "private"

Once we had made this change, we had the caching behaviour that we required.

Once again, thanks to all those who helped,
Geert