Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2004, 07:09 PM
Authorized User
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to force a webpage to not save in history.

Hi:

     I have a simple static web site, but it is updated daily.
     The users of this website are not able to see my updated website unless thay click on refresh button.

     Actually, webpage is stored in system history, and when user open the same page, browser bring that page from system history. So user are not able to see my updated pages.

     How to force a web page to not save in system history.

Thanks

 
Old June 8th, 2004, 07:29 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Try <meta http-equiv=refresh content=0;url=wherever.php>

Or location.replace("wherever.php");

HTH,

Snib

<><
 
Old June 8th, 2004, 08:23 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

It looks like you don't want your page to be cached.. on the client-side that can be done with this meta tag, insert between <head></head> tags.

Code:
<meta http-equiv="PRAGMA" content="NO-CACHE" />
Alternatively if you are using a server-side language you can also do this in the HTTP headers. This is the PHP version. But you can make HTTP header changes with any server-side language, the headers will be the same.

Code:
header("Expires: Mon, 14 Jul 1789 12:30:00 GMT");    // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");                          // HTTP/1.0


Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::





Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser history abdul_owiusa Javascript How-To 11 October 13th, 2006 09:13 AM
How to clear history toshi Javascript 0 August 17th, 2006 06:07 AM
history.back(-1); elania Javascript How-To 3 February 2nd, 2005 03:14 PM
Window.History pvasudevan Javascript 5 September 4th, 2004 03:49 AM
Record History cdenequolo Classic ASP Basics 2 December 3rd, 2003 12:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.