You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by monarchs <aj...@gmail.com> on 2007/12/14 20:38:06 UTC

[users@httpd] caching of static images

A question about the caching of static images, if the response header
contains both Expires and Etag, will the client browser make call to server
to validate Etag is fresh. I want to avoid the 304 requests as I know the
files will never change, and want to know if setting both headers causes any
issues.

here is the sample response.

Status=OK - 200
Date=Fri, 14 Dec 2007 17:35:35 GMT
Server=Apache/2.0.52 (CentOS)
Last-Modified=Fri, 14 Dec 2007 10:01:16 GMT
Etag="79c4df-33a-24acf300"
Accept-Ranges=bytes
Content-Length=826
Cache-Control=max-age=2592000
Expires=Sun, 13 Jan 2008 17:35:35 GMT
Connection=close
Content-Type=image/png

thanks!
-- 
View this message in context: http://www.nabble.com/caching-of-static-images-tp14339755p14339755.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] caching of static images

Posted by Joshua Slive <jo...@slive.ca>.
On Dec 14, 2007 2:38 PM, monarchs <aj...@gmail.com> wrote:
>
> A question about the caching of static images, if the response header
> contains both Expires and Etag, will the client browser make call to server
> to validate Etag is fresh. I want to avoid the 304 requests as I know the
> files will never change, and want to know if setting both headers causes any
> issues.

This is up to the browser. I believe that in their default config,
most browsers will do an if-modified-since request once per session
but use the cached copy otherwise if the Cache-control max-age is set
correctly. Expires is not used by HTTP/1.1 browsers and I don't think
any of them care about etags if Last-Modified is present.

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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org