Reply to Re: HTTP question - file that never changes

Your name:

Reply:


Posted by Jim Higson on 03/09/06 22:05

Michael Winter wrote:

> On 08/03/2006 11:51, Jim Higson wrote:
>
> [snip]
>
>> Because the resource for a given URL never changes, browser cache is
>> always safe to use and there is no need to revalidate. What are the
>> best HTTP header(s) to use to indicate this, and how should they be
>> set in Apache?
>
> There is no specific method with to mark a resources as indefinitely
> 'fresh'. However, one can get close by sending an Expires header or a
> Cache-Control: max-age directive set far into the future.
>
> The RFC 2616 (HTTP/1.1) has a note on this practice:
>
> To mark a response as "never expires," an origin server sends
> an Expires date approximately one year from the time the
> response is sent. HTTP/1.1 servers SHOULD NOT send Expires
> dates more than one year in the future.
>
> -- 14.21 Expires, RFC 2616
>
>
> The directives below will prompt Apache to send both an Expires and
> Cache-Control header, instructing caches to treat all PNG images
> (image/png) as fresh for 365 days from the time of access. That is, each
> time a request is made to the origin server, a different expiry date
> will be calculated.
>
> ExpiresActive On
> ExpiresByType image/png A31536000

Out of interest, why not write it as:

ExpiresByType image/png "access plus 1 year"

Which seems to be legal according to this page:
http://httpd.apache.org/docs/2.0/mod/mod_expires.html

> These directives require the mod_expires module.
>
> Hope that helps,

It does. I'll ask the server admin to enable the module.

--
Jim

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация