• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

I need to command HTML to reload a site on opening so it is guarenteed current

I finally got the frames all figured out but know it doesn't refresh the page automatically to guarentee its correctness.  The only way I can see it most current is by clearing the web content on my PC and coming back.  The navigational bar is programmed in JavaScript and mainly everything else is in HTML.

Site: http://www.freewebs.com/demogovclan/

Note: The only page with info thus far is the News page.
0
FordGT90Concept
Asked:
FordGT90Concept
  • 5
  • 5
1 Solution
 
ZontarCommented:
Put these inside the <head>...</head> tags

<meta http-equiv="Content-Expires" content="Tue, 01 Jan 1980 12:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
0
 
FordGT90ConceptAuthor Commented:
not a clue what those lines mean but i'll give it a go...
0
 
FordGT90ConceptAuthor Commented:
<HEAD>
<meta http-equiv="Content-Expires" content="Tue, 01 Jan 1980 12:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
</HEAD>

Is what I added and it didn't work :(
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
FordGT90ConceptAuthor Commented:
Ah, I had to empty the history first then refresh.  So far so good.  Thanks for the help.
0
 
ZontarCommented:
Another trick is to place the following JS code in all your pages:
<script type="text/javascript">
window.onload = fixLinks;

function fixLinks()
{
  var timeStamp = new Date().getTime();

  if(document.links[0].search.indexOf("?") == -1 && self.location.href.indexOf("?ts=") == -1)
  {
    self.location.href += "?ts=" + timeStamp;
  }
  else
  {
    var allLinks = document.links;

    for(var i = 0; i < allLinks.length; i++)
      allLinks[i].href += (allLinks[i].href.indexOf("?") != -1 ? "&" : "") + "?ts=" + timeStamp;
  }
}
</script>

This adds a querystring in the form of a millisecond timestamp to all the links on your pages, which will make the browser think it's not visited them before.
0
 
ZontarCommented:
>  Ah, I had to empty the history first then refresh.

LOL, no worries there, mate, my pleasure.
0
 
FordGT90ConceptAuthor Commented:
should the HTML coded one be placed on every page or which ones?
0
 
ZontarCommented:
All of them. Any page you don't want to be cached.
0
 
FordGT90ConceptAuthor Commented:
Okay, thanks again for the help.
0
 
ZontarCommented:
No worries. :^)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now