tags:

views:

1674

answers:

5

I have a website that because of an ill-prepared apache conf file has instructed users to cache a website URL several years into the future. As a result, when a person visits the site, they often make no attempt to even request the page. The browser just loads the HTML from cache.

This website is about to get a major update, and I would like for users to be able to see it. Is there a way for me to force a user to actually re-request the webpage? I fear that for some users, unless they happen to press F5, they may see the old webpage for several years.

A: 

I think that there is no way of doing this. If they never contact your sever there really is nothing you can do about it.

Jack Ryan
+1  A: 

Use different URLs. If the main entry point to your website (like the main index file) is cached, then you're screwed... maybe you should register another domain name?

liori
The site ranks high in search engines; A different url would not work in our case base of the SEO penalty
Chris
You can make it a different URL by adding a URL parameter, like a timestamp: ?new=<timestamp>. This would not screw up the SEO.
Julien
A: 

There are several options to achieve this First In the section add meta tag:

<meta http-equiv="pragma" content="no-cache" />

Basically the browser won't cache the page.

Another option is to set sessions, this will force the browser to a new session each time they go, and thus make the browser get the page from the server instead of the cache

<?php
session_start();

$_SESSION = array();
session_destroy();

?>

You can add this to your website for a couple of days and then remove. I really don't know if it will do, but perhaps you will find it useful

Sorantis
If the browser has the page in cache, it'll never hit the server, so this won't help at all.
ahockley
Right..My bad..
Sorantis
Yeah, I just gave this a try and it didn't work. Thanks for the idea though.
Chris
A: 

change URLs of every resource

Alex. S.
+2  A: 

It is arguable that if your "major update" is just in a few (2 or 3) weeks, you only need to reconfigure your apache conf now (no far future stuff for html - only for assets and content that will most likely never change). The Firefox cache is ie 50MB by default and that's not much because images get also cached and mordern websites have a lot of content.

Not perfect - but thats what I would do - when I don't want to or can't change the URL's ;)

biophonc
This is what I hope will happen. I updated the the apache conf a few weeks back to remove the caching. It seems there is really no way to force the refresh.
Chris