Avoiding Accessing The Cache

Hai guise!

I’m doing some webdesignthingsies for a client, and I update them manually via html because I suck at database coding.

Anyway, when I upload updates, it seems regular visitors have to manually reload the pages to get the news, and that’s no good at all. Now, I could learn new tricks, but I dunno… I’d just love to have some extra tag or something that makes the link users click automatically fetch it online in stead of from the cache.

Any ideas? Or should I just suck it up and learn to program database?

Doesn’t have anything to do with database, but .php would be very useful:

http://www.php.net/header

header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1  
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past  

Hum, so if I add these lines to the header of the host page (I’m using iframes), I’ll avoid the cache?

Or should I read a lot more first? :)

Insert those headers in every php-script. Should be enough…

Yeah, but take note that headers need to be sent before the actual content of the HTML page is sent.

by the way… you have to learn php little bit! it s not exactly like html code save as .php :D
I know it s free but it s much more hard than asp :)

If the webserver is configured to parse .php, it actually is nothing more than renaming .html files to .php… then insert this snippet at the very top of the former .html file: ```

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past ?>
All done.

Brilliant, thanks a lot guys! :D

I did the simple solution and renamed html to php with the php-text on top, updates perfectly. Now, the only challenge will be to make sure regular visitors clear their cache so the new index.php loads in stead of their old cached index.html. At least this will be the way I do it from now on in future projects, mayhaps a bit more complex of course.

I’ve got a job interview for a flight attendant position on monday which would mean exellent pay and exellent work for me, here’s crossing my fingers! :D