Re: [users@httpd] Image caching / Expiry times / 304s

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

 



On 6/6/06, Matthew Claridge <mclaridge@xxxxxxxxxxxxx> wrote:


on 06/06/2006 14:30 Joshua Slive said the following:

> On 6/6/06, Matthew Claridge <mclaridge@xxxxxxxxxxxxx> wrote:

>> We've looked into mod_expiry, but this doesn't really work, because as
>> soon as the expiry time is reached the browser starts requesting it
>> again and a new expiry is never set until the server actually sends the
>> image, so we can make this work with huge expiry times, but thats just
>> not practical as it means the images are never requested even if we've
>> changed them.
>
>
> Two issues here:
>
> 1. The server should indeed be updating the Expires and Cache-Control
> headers even on 304 responses.  See RFC2616 section 10.3.5.  If it is
> not doing that, it is a bug.  (It may also be a bug in the client that
> ignores the updated Cache-Control.)
>
> 2. A good practice is to set very-long expire (Cache-Control: max-age)
> headers on your images and then *never* change them.  If you need to
> update the content, use a different filename.  Of course, I believe
> most browsers and caches tend to ignore expiry dates more than a day
> or so in the future anyway.

Thanks for this. I originally thought your first point was correct and
that this was a bug. Certainly it was reported as a bug in version 1.1.1

However, the docs for v2 state that once the expiry has passed, that
copy of the file is considered invalid and a new copy of the file MUST
be obtained from the server. This will of course never happen because
the server just sends 304s :-)

The documentation you quote is just a general statement to help people
understand how cache-control works.  It is not an authoratative
documentation on http caching rules.  That is contained RFC2616.  In
this context, "a new copy" should also include a 304 response with an
updated expiry time.

Have you actually tested this?  It should be easy enough to just make
sure that apache is updating cache-control headers in 304 responses.
No point arguing theoretically over something that is so easy to test.


Re your second point, if browsers ignore long expiry times anyway, then
we are stuck with dealing with the 304 reponses, right?

Yes, I think you can expect at least one 304 a day from each client.
But that is just a guess.  Again, testing is the way to go.

Joshua.

---------------------------------------------------------------------
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