Click to See Complete Forum and Search --> : Problem with cache
scramble
01-09-2003, 07:58 PM
Hello everybody.
I have a website and i'm using an iframe, i open pages in that eframe, like a page for news for example. The problem is that i update the files (add a new message, news or something), and the ppl can't see em, they still see the old non updated file. the the problem fixes when they hit CTRL + F5 inside of the iframe to refresh the page and update the cache (only F5 doesn't work).
Now my question is, is there any way using scripts that the page automatically update the cached files in visitors HD?, i saw a script a while ago but now i can't find it.
Hope u can help me with this.
Thanks in advance.
The site is www.byerror.com (http://www.byerror.com)
scramble
01-09-2003, 09:53 PM
Thanks for your reply.
Where exactly should i put that line of code?
Excuse my ignorance on this topic.
jdavia
01-09-2003, 10:34 PM
When that happens, are you editing the page? If so your editor might be making a temp file and that is what you might be seeing until you save the changes
If on the web and you use the back button, you are opening a back copy in your Browser's cache. That is not the same as downloading the same page again from the web. Your Browser compares it to what is in cache for the newest one.
The script is already in the Browser to handle it. Check all the settings.
Thanks to everyone who gives thier time to this terrific forum.
I am very interested in the code that Dave Clark suggested for updating an i frame by utilizing a time mehtod:
var now = new Date();
self.frames["iframeName"].location.href = "url?"+now.getTime();
... however I (like Scramble) am not familiar enough with JavaScript to know how to insert it into the i frame so that it will work.
I'd appreciate a sample if possible.
khalidali63
01-14-2003, 11:27 AM
You may want to try a solution that you do not need to worry about browser compatibility.
put the code below in the head section of your pages that you want to open in the iframe
<meta http-equiv="Pragma" content="no-cache">
Khalid
Thanks Khalid.
I am using that META tag, but I also want to automatically refresh the page (actally just the i frame needs to be refreshed) after a certain period of time while the user is viewing the page.
It seems that Dave Clark had the right solution - but I don't know how to apply it.
... any help on that?
Thanks
T
Webskater
01-14-2003, 11:56 AM
This meta tag causes the page to reload every 300 seconds.
meta http-equiv=Refresh content="300"
khalidali63
01-14-2003, 12:15 PM
I second the webskaters solution.that reduxes any extra scripting.
<meta http-equiv="Refresh" content="300">
you can put this element in addition to the one earlier in the head section of all the pages you want to open in the iframe.
or if you do want to use javascript to reload teh iframe from the parent frame
then put the following code in its entirety in the head section after the any meta tags you may have.
<script language="JavaScript1.2">
function reloadFrame(){
parent.frames[0].document.location.href=parent.frames[0].document.location.href;
setTimeout("reloadFrame()",3000)
}
window.onload = reloadFrame;
</script>
</head>
<body>
<iframe name="ifrm" src="Blank.html" width="100%" frameborder="1"></iframe>
Hopefully it's not improper protocol for me to express my thanks to the 3 of you (Dave Clark, Khalid, Webskater) for your assistance on this forum (if so, let me know so that I don't continue to do so in the future).
All of the info (seperately and combined) has proven to educate and guide me. I cannot thank the 3 of you - and the forum as a whole - enough for all of this invalauble information.
Many thanks
T