Re: Re: way for me to turn off if-modified-since & always return 304 reply ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Britain wrote:
On Sat, 13 Sep 2008 08:13:51 +0100, "dave selby"
<dave6502@xxxxxxxxxxxxxx> wrote:

2008/9/12 Scott Gifford <sgifford@xxxxxxxxxxxxxxxx>:
"dave selby" <dave6502@xxxxxxxxxxxxxx> writes:

Is there a way for me to turn off if-modified-since so the client
browser will ALWAYS use its locally cached document
Dave,

Usually sending an Expires header will tell browsers to mostly use a
cached version.  I use something like this to set my expires time to
quite a bit in the future:

  <Directory /path/to/dir>
     ExpiresActive On
     ExpiresDefault A86400000
  </Directory>

This is part of mod_expires:

   http://httpd.apache.org/docs/2.0/mod/mod_expires.html

Also, it would really surprise me if Apache used the parent directory
in deciding about IMS requests.  You might want to do some simple
experiments to verify this is what it's doing.
Thank you, thats useful. Something odd is definitely happening.

That part of my app as of last night is in pieces (joys of software
development) but I am hopeing to rebuild it over the next couple of
days. I will do some experiments & repost here.

Just out of curiosity, I looked up Etags on wikipedia -- most
interesting, in relation to caching, and what apache uses for
generation and comparison.

In short etags are like a cookie.. for changed/unchanged content, and
is used in combination with the date-time stamp, with preference given
for the e-tag Z(different e-tag = different content)...  changing the
inode of a file changes the e-tag...  Apache has mechanisms for
controlling etag generation...

Re: http://en.wikipedia.org/wiki/HTTP_ETag
    http://www.iwaw.net/04/Clausen.pdf -- (paragraph: 10)towards the
end... (worth reading the whole thing) -- details are a little buried,
pointing toward further research in Apache docs/code.

I vaguely remembered something like that, which is why I mentioned it.
I was thinking that if one really wanted to fool the browser, one may need to add an Etag: header, with the same value as what the browser sent. That would be possible using SetEnvIf and mod_rewrite and mod_headers. But maybe just ignoring the Etag header has the same result.

I have started to play with mod_rewrite in the meantime, for another issue. It's amazing what that thing can do. And it is a standard Apache 2.x component, so if your application is based on Apache being there anyway, you would not introduce anything "foreign" by using it.
mod_headers and mod_rewrite also by the way.
It seems a pity not to use these tools if they are available.

I have an application that runs on multiple platforms (Solaris, HPUX, various Linuxes, Win32), based on Apache, mod_perl (perl integration in Apache), and to a lesser extent Tomcat and thus Java. So far, over several years, I have not encountered any serious incompatibilities between platforms with any of these packages. Your mileage may vary of course.

All of the above rests on the assumption that you have a problem because Apache considers the image files as modified for some reason. As someone pointed out however, that looks suspicious, and should really be checked first.

Another tidbit that comes to mind, is that the browser is not the only agent that may play a role here : there could be any number of proxies between your server and the browser, and one of them might decide to re-retrieve the object for some reason of its own. So you might still want to make sure that you are setting the proper caching HTTP headers, or at least not setting some that prevent caching.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux