So there’s a website I’m in charge of which currently uses a simple two-frame design: A navigation frame on the left, and a content frame on the left. So 90s, I know. People who have the site bookmarked are most likely to have http://www.example.com bookmarked, which with the current implementation, points to index.html which provides the frameset, pointing to sidebar.php and main.php.
I’m ready to roll out the new version of the site, which doesn’t use frames at all. The index page in this case will be index.php. But the problem is, browsers love to cache the frameset pages, which is a big problem since sidebar.php got moved and main.php isn’t supposed to exist anymore. So a big chunk of users would get two 404s at once and get massively confused, even though a simple skip-cache-refresh solves the problem (but I can’t assume that they’d know this).
At the moment, the best I can do is have main.php be a page telling the visitor, “Hey, your idiot browser cached a frameset that’s defunct now, here’s how to tell your browser to skip the cache and reload.” Alternatively, I can put this JavaScript in main.php:
if(top !== self)
top.location.replace(self.location.href);
window.location = 'index.php';
That does a successful redirect, but every time my lovely cached visitors go to www.example.com, they’ll keep performing that redirect until their browser decides to drop the frameset page from their cache, which causes two HTTP GETs per visit, a delay in getting to what they want, and is in general a suboptimal solution to the problem.
Is there any way, through a combination of HTML, JavaScript, and PHP, that I can tell the browser to drop the frameset page from its cache and actually do a “GET /” from the server, without having to tell the user to do it manually?