What's new
Guest viewing limit reached
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation
  • Already a member? Click here to login

Forcing a web page not to cache

Goshzilla

Mastermind Talker
PF Member
Messages
1,008
Highlights
0
Reaction score
0
Points
402
Peak Coin
0.000000¢
DB Transfer
0.000000¢
Anyone know the tag/meta command to do this. I have a webcam page that refreshes every minute but sometimes the cached page won't update since a local copy exists. ANyone know a way around this.

------------------
--Dann
Go soak your big fat head-- Attack of the Giant Leeches
 
well
i had a similar issue
and since all i was doing was needing the actual image to refresh i used the following......

<script language='javascript'>
<!-- preload -->

function MakeArray(n) {
this.length = n
for (var i = 1; i<=n; i++) {
this = new Image()
}
return this
}

pictures = new MakeArray(1)

pictures[1].src = "http:/foo.com/bar.jpg"

function replace_pic(place) {
if (document.images) {
counter1 = document.images.length - 1
for (i=1; i<=counter1; i++) {
if (document.images.name == place) {
document.images.src = pictures[place].src
i = counter1
}
}
}


<!-- end preload -->
}

</script>



------------------
http://www.moonsee.com
 
The meta tags for disabling cache on a web page are :
Code:
<META HTTP-EQUIV="expires" CONTENT="Wed, 20 Feb 2000 08:30:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
Just in case your not sure the
Code:
<META http-equiv="Refresh" content="60; url=http://yourdomain.com">
Will refreash the page for you every 60 seconds.


------------------
Jedi mind tricks don't work on me....
I think ...
 
Cool. Thanks for the code and HTML samples.
smile.gif
Could come in handy for dev activities, in the future.

------------------
Does driving a car from Saturn make me an alien?

I'm just a quick pee. - liltaz, fastest pee in the West!

That which does not make me barf, makes me stronger - possum37, fugly.net guru.
 
Ah, so the page expires in the past.

Any reason to choosing Feb 2000 or did you just pick a date.

Anyhow, mucho thanks for the code.

------------------
--Dann
Go soak your big fat head-- Attack of the Giant Leeches
 
No real reason any date in the past will work just fine.

------------------
Jedi mind tricks don't work on me....
I think ...
 
Back
Top