Overriding the browser cache when a web page changes

I recently agreed to be the “webmaster” for a recreational music organization in New England. My duties and powers are limited to client-side stuff - HTML, CSS, and Javascript. I ftp files to the server but someone else manages the (Apache) server configuration.

The problem we are having is that when the web page changes to reflect some new upcoming event, visitors see the old one if their browser has cached it. Our visitors are not PC or web savvy so they don’t know to reload the page or clear the cache on their browsers.

How can I force the latest copy to appear on their browsers?

Thanks in advance!

PS - In the old days we could try using the PRAGMA “no-cache” HTML metatag, but my understanding is that’s obsolete now

Hello, You may try to set headers of the page

in php its going to be:
header(“Cache-Control: no-cache, must-revalidate”);
header(“Expires: Sun, 17 May 2006 00:00:00 GMT”);
header(“Pragma: no-cache”); // not sure about this one - it’s from http 1.0 rev - just need to try

or this one:

header(“Cache-Control: no-store, no-cache, must-revalidate”);
header(“Expires: Sun, 17 May 2006 00:00:00 GMT”);

hope one of it will help you.

As I said, I’m only allowed to do client-side stuff - HTML, CSS and javascript. No PHP.

Do you have access to a .htaccess file? Or can you add little bits of PHP to your page templates? There is a handy overview of options here:

It is something that has to be done on the server when sending the pages so if you don’t have access there then you will need to ask someone who does have the access to make the change.

Legally, no, but I can see the .htaccess file and ftp it. The group that this music organization is part of supports other recreational activities (hiking, biking, skiing, windsurfing, etc) which each have their own websites. The .htaccess file would apply to all of them so I think it would be unethical for me to change them it.

There’s practically nothing in it now:

DirectoryIndex index.htm Index.htm index.shtml index.html index.asp default.htm index.phtml index.php index.pht index.php3 index.cgi welcome.cgi welcome.html default.html home.htm
Options -Indexes

I assume a “Header set Cache-Control …” or "Header set Expires " would do the trick?