Solved

Server cache and blah..

Posted on 1998-09-02
4
197 Views
Last Modified: 2010-04-09
my web site is located on a virtual server running IIS4. on the site, i'm hosting a webcam and a few isapi extensions..

the problem is, the server is set up to cache files.. when, for example, a few people look at the webcam for a few minutes, the picture will hang after a while because the server begins caching it. thus it won't reload the newest picture even though it's reloading..

this caching ALSO causes a problem for my isapi dlls.. apparently, when a dll is loaded on my site, the nt box won't let go of it incase i need to delete/update it..  

i know caching can be turned off on the server, but 1) i don't have access to the server (because again, it's a virtual host and i have no physical contact with the machine) and 2)my provider says the only way they know how to disable the cache is to disable it for the whole machine.. obviously this would slow down the machine considerably..

my question: is there a way to write something in my html files that will make sure the file doesn't get cached? or is there another way to get around this?

0
Comment
Question by:rabbitears
  • 2
4 Comments
 
LVL 4

Expert Comment

by:martinag
Comment Utility
Try this in your <HEAD>:
<META NAME="pragma" CONTENT="no-cache">

Martin
0
 
LVL 4

Expert Comment

by:martinag
Comment Utility
And in perl scripts you can print it with the header like this:
print "Content-Type: xxx/xxx\nPragma: no-cache\n\n";

Martin
0
 
LVL 1

Accepted Solution

by:
drepetto earned 50 total points
Comment Utility
If yo're looking for the fast&easy way...

<META HTTP-EQUIV="Refresh" CONTENT=300 >
<META HTTP-EQUIV="Expires" CONTENT="Thu, 03 Sep 1998 09:25:08 GMT">

Is an example that instruct the cache and the browser on how to treat your page.
Thus you can control how long your documents may be cached and how often
your pages must be (automatically) RELOADED by the remote browser.
Very handy for the WEBCAM.
(Remember that upon RELOAD requests cahes get purged.)
note: When you hit RELOAD on IE4 it actually does a REFRESH not a RELOAD.

The other way, as suggested by martinag, instead will whitch off the cache
without any condition and I suggest you use it for your scripts.

"      <META NAME="pragma" CONTENT="no-cache">

And in perl scripts you can print it with the header like this:
      print "Content-Type: xxx/xxx\nPragma: no-cache\n\n";
"
Also, you should be aware that well behaving caches will not cache
URLs that contain  "cgi-bin" or "?".

Try asking your provider which kind of cache stoplist does he use.
0
 

Author Comment

by:rabbitears
Comment Utility
the <META NAME="pragma" CONTENT="no-cache">  solution will probably work best.. on a webcam though, the refresh method is not always good if you're loading more than one picture or one larger picture because if the refresh rate is like 15 seconds, the page will try to refresh before the picture is done..

for that i have used ONLOAD in the body and history.Go(0) in a function..
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now