#!/usr/bin/perl -Tw ############################################################ # name: Cache # author: Ian Hickson # license: GPL # description: cache tests # This test is at: # http://www.bath.ac.uk/%7Epy8ieh/cgi/development/tests/cache ############################################################ use strict; use CGI qw/:standard/; use HTML::Entities; my($now, $text, $newtext); if ($text = param('text')) { $now = gmtime; $now = encode_entities($now); $text = encode_entities($text); open(OUT, ">cache.html") or die "Can't open HTML file for output.\n".$!; print OUT < Cache Tests - Test File

Cache Test File

This file was last modified on: $now.

The stylesheet was last modified on: .

To change this file, use the related cache test script.

EOF close(OUT); open(OUT, ">cache.css") or die "Can't open CSS file for output.\n".$!; print OUT < Cache Tests - Test File

Cache Test File

Hi, welcome to the cache checker. This is a script which will update a particular, non-CGI, file. By looking up this file you can then decide if the cache in your browser is working correctly, or if it is using its cached copies regardless of the changes the server reports.

Note that it is quite possible that some of the software between your cache and the file, including proxy servers, TCP stacks, and the web server itself, are buggy. Don't assume the problem is your end. I would love to hear of any bugs you discover (particularly if they are with this script or the Apache server serving the file in question).

To change the file, hit the Change button:

EOF if ($now) { print "

The file should now contain the date $now.

"; } print < EOF