[thelist] AOl proxy cache

Seb seb at members.evolt.org
Tue Jul 17 11:47:42 CDT 2001


Bill's at it again with:

> So, I apporached my hosting provider with the idea of configuring Apache
to
> serve up specific headers. Here's what they said:
>
> > For Caching I believe there is a way of coding where you can specify to
> the
> > browser that the pages should not be cached. I also think that AOL will
> not
> > cache PHP pages as they are scripting and can change each single time.
>
> Any comments as to the validity of this statement?

Okay.

Most proxy servers will not cache a page with data in the querystring. That
is, they will cache http://members.evolt.org/seb/index.php , but they should
not cache http://members.evolt.org/seb/index.php?bite=me

MS Proxy Server 2, some AOL caches (the older ones, it appears), and some
miscellaneous caches will still cache pages with data in the querystring.
This has been the downfall of many a financial institution in the past
couple of years. (Barclays and Egg in the UK have suffered from this.)

Now, it is really important to understand the following point:

AOL's proxy system does not read HTML. Use of the META HTTP-EQUIV tags in
the content of web pages (in either HEAD or BODY) does not control the
behavior of AOL's proxy caches

This means that you *MUST* alter the HTTP headers returned by the webserver
*BEFORE* outputting any HTML.

Effectively, there are 2 ways to do this:

1. With your webserver, configure it to return the correct HTTP headers.
This will affect all pages returned from your webserver (or the subsection
affected). Apache, iPlanet, IIS, all allow this.

2. With your server-side script, rewrite the HTTP header in the Response
object before you add content. ASP, PHP, Perl, SSJS, JSP... they all allow
you access to the Response object and the HTTP headers. You *CANNOT* do this
in plain HTML or client scripting.



As far as cacheing PHP pages is concerned, see my first paragraph. If you
want to ensure that they are not cached, use the header() function to add
HTTP headers and call it as the first thing on every page of your site.

It might go something like:

<?
header ("Pragma: no-cache");
header ("Cache-Control: no-cache, must-revalidate, max_age=0");
header ("Expires: 0");
?>



Seb.
http://www.sebpotter.org





More information about the thelist mailing list