Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caching Issue

Status
Not open for further replies.

fmrock

Programmer
Sep 5, 2006
510
US
Hey Everyone,

I mostly work with Dynamic pages, so this has never been an issue for me.

However, I have to edit an existing page that links to a .html page and after I update it, the page is cached, until i hit the refresh button.

I have googled and found some meta tags to add, but they still dont seem to be working.

Code:
<head>
<title>Work Opportunities</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<meta http-equiv="cache-control" content="private">
<meta http-equiv="cache-control" content="max-age=0, must-revalidate">
<meta http-equiv="expires" content="now-1">
<meta http-equiv="pragma" content="no-cache">
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>

Any other ideas on what I can do?

I am testing in both IE and FF with the same results.
 
I wrote a post on a Grails forum about this only a few days ago:
[URL unfurl="true"]http://stateyourbizness.blogspot.com/2008/09/inspecting-response-headers-in-browser.html[/url]

If you have access to the back-end you can control the headers of the file directly (as described in the post above). Here is a PHP version of the Grail post linked above:

Code:
<?
    header("Pragma: no-cache");
    header("Cache-Control: no-cache, no-store");
    header("Expires: 0");
?>

You can achieve the same thing using just HTML using the following:

Code:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store">
<meta http-equiv="expires" content="0">

I haven't got my notes with me from when I was working on this problem, but I think that about covers it.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top