[AWS] How to avoid caching?

David Marceau davidmarceau@sympatico.ca
Wed, 12 Feb 2003 04:57:13 -0500


"Alejandro. R. Mosteo Chagoyen" wrote:
> 
> Hello David,
> 
> > -I recently read somewhere when you name the file starting with "nph-"
> > the web browser doesn't cache the file.
> > i.e. try naming your url as
> > http://www.bla.blah/awsdemos/nph-alejandroguitest
> 
> The easiest solution. I'll try it. I had no notice of this convention.
> 
> > -read the web browser docs on how to disable the cache, most browsers
> > have this.
> 
> Whereas this solution is also easy, I consider it not acceptable
> because when I deploy the app, I don't want to state in its
> requirements: "you must disable your browser cache". I find it too
> intrusive and unfriendly.
I agree :)

> 
> > -read the http protocol docs and look for keywords cache & disable, add
> > it to your code if you really have to.
> 
> I have these located, I'll add them anyway (just in case) to my
> templates.
Yes this is the best alternative.

> 
> > -maybe read squid docs if you're running it on a linux system since
> > squid if I understand correctly also does some web page caching.  Also
> > look for keywords cache and disable. -better yet for your tests just
> > stop this daemon :)
> 
> Don't apply ;-) I'm on windows but note taken for the future.
hmm.

> 
> > -if all these don't work out, just press the reload button on your
> > browser.  This if I understand correctly always ignores the cache if
> > page is already displayed.  i.e. if you had a counter being
> > displayed...reload...reload.. reload would increment it three times.
> 
> That's correct: reloading updates the page. The problem is that I have
> a navigation bar, and no matter how many times I click each link in
Ahh.

> it, the page doesn't refresh (until cache time expires). So, say, if I
> go to a section, I would be forced to hit refresh every time after
> going to that page, and I don't like that.
Neither would I.

> 
> > One question for you:  what exactly necessitates you to cache off?
> > Please be verbose if you want a better opinion.
> 
> Well, the main concern is the last point: using my navigation bar
> shows always the cached pages because the URLs are static. I presume
> (not tried yet) that cache headers can solve that for templates. But
> some of the pages are created with Response.Build, taking simple
> strings as parameter, and these are the main problem.
> 
> These pages show live info from my app. (For example, the system log,
> which is a list of events. Another is a list of active servers). The
> urls used are simple: /log, /servers and the like.
> 
> I just have found that this problem is Opera specific: Explorer 6
> reloads the pages. Both with default configuration.
> 
> Many thanks for your response,
> 
> Alex.
> 
> P.s: A side note. I've not found an evident way to specify the
> interface to which is bound the web server. I'm interested to only
> reply on 127.0.0.1 or, at least, made it optional to listen on all
> interfaces.
I believe you just asked a few questions:
1)how does the ada web server bind to only one of many network cards in
my machine?
2)how does the ada web server filter which client ip accepts connections
from?

Well on both counts you got a few alternatives:
-configure the hosts.equiv to exclude everybody except localhost
-configure the networks to exclude everybody except localhost
-configure say you have two cards eth0 eth1 to have different ips
-somewhere in your code, the ada web server start service has a parm for
setting the web server on a certain hostname/ip/port.  You can set this
to localhost or 127.0.0.1.
-you can limit the net to just that computer for that network interface
using a subnet mask of 255.255.255.254
-you can actually accept all connections from any ip and just if the
client ip is localhost then do something.  Otherwise build an
appropriate response saying "Sorry only the network admin has access to
this url...please contact blah@blah.blah".

Ok I'm rambling....there's probably more alternatives but I hope this
clarifies what you can do.

Cheers,
David Marceau