# HTML Code Needed to Automatically Refresh The Page



## preitzes (Jan 17, 2005)

I run a free online journal with a buddy and we do the html ourselves. This is truly a labor of love!

We would like to find some general or generic html code that can be used so that every time someone clicks on our journal, it automatically refreshes the page. We have many subscribers who write us and say that every time they visit our page to see the new issue, they get the previous issue. So we always write back and ask them to click the “refresh” button which always works. 

Can someone provide us with code so that when our page is bookmarked or re-visited, the page refreshes?

Thanks so much!


----------



## DJ-Zep (Mar 11, 2006)

I see what you are saying. Computers use something called a "cache". This saves your computer work by storing files that you visit online so that it doesn't have to redownload them every time you visit the same site. Unfortunately, there is no code to change this. However, you can create a splash page (a page that says enter with a picture or logo). This will show the newest version of the issue every time they click the link on the splash page.


----------



## preitzes (Jan 17, 2005)

Thanks!

Someone told me that there was a way to insert code that would trick the browser to think it is a different year, thus always opening the most current version of the page. I guess this was not true?

Thanks again!


----------



## preitzes (Jan 17, 2005)

Oh, one more thing. How do the NY Times and other major Web sites get away with not having a splash page? I never hear of those papers coming up with previous issues.


----------



## DJ-Zep (Mar 11, 2006)

preitzes said:


> Oh, one more thing. How do the NY Times and other major Web sites get away with not having a splash page? I never hear of those papers coming up with previous issues.


They most likely use advanced coding that imports the new articles (such as php includes). This is kind of like the main page being the spalsh page with the new information built in.


----------



## preitzes (Jan 17, 2005)

Thanks so much!


----------



## gamerman0203 (Oct 28, 2005)

Depending on your hosting operating system and if your hosting has ASP or PHP installed, there is a simple line you can put in at the top of the page that makes the browser not cache the page and bring up the fresh version.

In ASP the code is this: 
<% Response.expires = 0 %> 
but that is only if your hosting with Windows. I just picked this up from a website so I'm not sure if it is right or not, DJ-Zep should be able to validate it:
<?php
header("Cache-Control: no-cache, must-revalidate"); 
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>


----------



## preitzes (Jan 17, 2005)

Yes, great idea. Thanks Gamerman!


----------

