首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

apache会缓存数据说明

2012-08-02 
apache能缓存数据说明What Can be Cached?As mentioned already, the two styles of caching in Apache wo

apache能缓存数据说明

What Can be Cached?

As mentioned already, the two styles of caching in Apache work differently,?If the response contains an "Authorization:" header, it must also contain an "s-maxage", "must-revalidate" or "public" option in the "Cache-Control:" header.

  • If the URL included a query string (e.g. from a HTML form GET method) it will not be cached unless the response specifies an explicit expiration by including an "Expires:" header or the max-age or s-maxage directive of the "Cache-Control:" header, as per RFC2616 sections 13.9 and 13.2.1.
  • If the response has a status of 200 (OK), the response must also include at least one of the "Etag", "Last-Modified" or the "Expires" headers, or the max-age or s-maxage directive of the "Cache-Control:" header, unless the?

    What Should Not be Cached?

    In short, any content which is highly time-sensitive, or which varies depending on the particulars of the request that are not covered by HTTP negotiation, should not be cached.

    If you have dynamic content which changes depending on the IP address of the requester, or changes every 5 minutes, it should almost certainly not be cached.

    If on the other hand, the content served differs depending on the values of various HTTP headers, it might be possible to cache it intelligently through the use of a "Vary" header.

    Variable/Negotiated Content

    If a response with a "Vary" header is received by?

    If for example, a response is received with a vary header such as;

    mod_cache?will only serve the cached content to requesters with accept-language and accept-charset headers matching those of the original request.