caching.html.en revision 4cf96a1611fa24f9ae90350afcede095d6f607a5
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose This file is generated from xml source: DO NOT EDIT
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<link href="/images/favicon.ico" rel="shortcut icon" /></head>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<p class="apache">Apache HTTP Server Version 2.3</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>Caching Guide</h1>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<p><span>Available Languages: </span><a href="/en/caching.html" title="English"> en </a></p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>This document supplements the <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code>, <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code>,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> and <a href="programs/htcacheclean.html">htcacheclean</a> reference documentation.
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose It describes how to use Apache's caching features to accelerate web and
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose proxy serving, while avoiding common problems and misconfigurations.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#introduction">Introduction</a></li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<li><img alt="" src="/images/down.gif" /> <a href="#overview">Caching Overview</a></li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<li><img alt="" src="/images/down.gif" /> <a href="#security">Security Considerations</a></li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<li><img alt="" src="/images/down.gif" /> <a href="#filehandle">File-Handle Caching</a></li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<li><img alt="" src="/images/down.gif" /> <a href="#inmemory">In-Memory Caching</a></li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<li><img alt="" src="/images/down.gif" /> <a href="#disk">Disk-based Caching</a></li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<h2><a name="introduction" id="introduction">Introduction</a></h2>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>As of Apache HTTP server version 2.2 <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose and <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> are no longer marked
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose experimental and are considered suitable for production use. These
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose caching architectures provide a powerful means to accelerate HTTP
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose handling, both as an origin webserver and as a proxy.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> and its provider modules
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> and <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose provide intelligent, HTTP-aware caching. The content itself is stored
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose in the cache, and mod_cache aims to honour all of the various HTTP
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose headers and options that control the cachability of content. It can
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose handle both local and proxied content. <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose is aimed at both simple and complex caching configurations, where
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose you are dealing with proxied content, dynamic local content or
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose have a need to speed up access to local files which change with
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p><code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> on the other hand presents a more
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose basic, but sometimes useful, form of caching. Rather than maintain
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the complexity of actively ensuring the cachability of URLs,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> offers file-handle and memory-mapping
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose tricks to keep a cache of files as they were when Apache was last
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose started. As such, <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> is aimed at improving
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the access time to local static files which do not change very
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>As <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> presents a relatively simple
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose caching implementation, apart from the specific sections on <code class="directive"><a href="/mod/mod_file_cache.html#cachefile">CacheFile</a></code> and <code class="directive"><a href="/mod/mod_file_cache.html#mmapstatic">MMapStatic</a></code>, the explanations
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose in this guide cover the <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> caching
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose architecture.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>To get the most from this document, you should be familiar with
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the basics of HTTP, and have read the Users' Guides to
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <a href="urlmapping.html">Mapping URLs to the Filesystem</a> and
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <a href="content-negotiation.html">Content negotiation</a>.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<h2><a name="overview" id="overview">Caching Overview</a></h2>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code></li><li><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code></li><li><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code></li><li><code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_cache.html#cacheenable">CacheEnable</a></code></li><li><code class="directive"><a href="/mod/mod_cache.html#cachedisable">CacheDisable</a></code></li><li><code class="directive"><a href="/mod/mod_file_cache.html#mmapstatic">MMapStatic</a></code></li><li><code class="directive"><a href="/mod/mod_file_cache.html#cachefile">CacheFile</a></code></li><li><code class="directive"><a href="/mod/mod_file_cache.html#cachefile">CacheFile</a></code></li><li><code class="directive"><a href="/mod/core.html#usecanonicalname">UseCanonicalName</a></code></li><li><code class="directive"><a href="/mod/mod_negotiation.html#cachenegotiateddocs">CacheNegotiatedDocs</a></code></li></ul></td></tr></table>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>There are two main stages in <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> that can
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose occur in the lifetime of a request. First, <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose is a URL mapping module, which means that if a URL has been cached,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose and the cached version of that URL has not expired, the request will
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose be served directly by <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>This means that any other stages that might ordinarily happen
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose in the process of serving a request -- for example being handled
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose by <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code>, or <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> --
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose won't happen. But then this is the point of caching content in
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the first place.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>If the URL is not found within the cache, <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose will add a <a href="filter.html">filter</a> to the request handling. After
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose Apache has located the content by the usual means, the filter will be run
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose as the content is served. If the content is determined to be cacheable,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the content will be saved to the cache for future serving.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>If the URL is found within the cache, but also found to have expired,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the filter is added anyway, but <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> will create
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose a conditional request to the backend, to determine if the cached version
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose is still current. If the cached version is still current, its
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose meta-information will be updated and the request will be served from the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose cache. If the cached version is no longer current, the cached version
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose will be deleted and the filter will save the updated content to the cache
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose as it is served.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>When caching locally generated content, ensuring that
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="directive"><a href="/mod/core.html#usecanonicalname">UseCanonicalName</a></code> is set to
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code>On</code> can dramatically improve the ratio of cache hits. This
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose is because the hostname of the virtual-host serving the content forms
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose a part of the cache key. With the setting set to <code>On</code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose virtual-hosts with multiple server names or aliases will not produce
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose differently cached entities, and instead content will be cached as
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose per the canonical hostname.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>Because caching is performed within the URL to filename translation
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose phase, cached documents will only be served in response to URL requests.
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose Ordinarily this is of little consequence, but there is one circumstance
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose in which it matters: If you are using <a href="howto/ssi.html">Server
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<!-- The following include can be cached -->
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<!--#include virtual="/footer.html" -->
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<!-- The following include can not be cached -->
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose<!--#include file="/path/to/footer.html" --></pre></div>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>If you are using Server Side Includes, and want the benefit of speedy
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose serves from the cache, you should use <code>virtual</code> include
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>The default expiry period for cached entities is one hour, however
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose this can be easily over-ridden by using the <code class="directive"><a href="/mod/mod_cache.html#cachedefaultexpire">CacheDefaultExpire</a></code> directive. This
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose default is only used when the original source of the content does not
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose specify an expire time or time of last modification.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>If a response does not include an <code>Expires</code> header but does
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose include a <code>Last-Modified</code> header, <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose can infer an expiry period based on the use of the <code class="directive"><a href="/mod/mod_cache.html#cachelastmodifiedfactor">CacheLastModifiedFactor</a></code> directive.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>For local content, <code class="module"><a href="/mod/mod_expires.html">mod_expires</a></code> may be used to
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose fine-tune the expiry period.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>The maximum expiry period may also be controlled by using the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="directive"><a href="/mod/mod_cache.html#cachemaxexpire">CacheMaxExpire</a></code>.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>When content expires from the cache and is re-requested from the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose backend or content provider, rather than pass on the original request,
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose Apache will use a conditional request instead.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>HTTP offers a number of headers which allow a client, or cache
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose to discern between different versions of the same content. For
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose example if a resource was served with an "Etag:" header, it is
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose possible to make a conditional request with an "If-Match:"
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose header. If a resource was served with a "Last-Modified:" header
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose it is possible to make a conditional request with an
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose "If-Modified-Since:" header, and so on.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>When such a conditional request is made, the response differs
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose depending on whether the content matches the conditions. If a request is
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose made with an "If-Modified-Since:" header, and the content has not been
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose modified since the time indicated in the request then a terse "304 Not
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose Modified" response is issued.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>If the content has changed, then it is served as if the request were
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose not conditional to begin with.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>The benefits of conditional requests in relation to caching are
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose twofold. Firstly, when making such a request to the backend, if the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose content from the backend matches the content in the store, this can be
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose determined easily and without the overhead of transferring the entire
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose resource.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>Secondly, conditional requests are usually less strenuous on the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose backend. For static files, typically all that is involved is a call
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose to <code>stat()</code> or similar system call, to see if the file has
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose changed in size or modification time. As such, even if Apache is
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose caching local content, even expired content may still be served faster
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose from the cache if it has not changed. As long as reading from the cache
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose store is faster than reading from the backend (e.g. an in-memory cache
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose compared to reading from disk).</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p>As mentioned already, the two styles of caching in Apache work
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose differently, <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code> caching maintains file
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose contents as they were when Apache was started. When a request is
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose made for a file that is cached by this module, it is intercepted
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose and the cached file is served.</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <p><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> caching on the other hand is more
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose complex. When serving a request, if it has not been cached
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose previously, the caching module will determine if the content
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose is cacheable. The conditions for determining cachability of
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose a response are;</p>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>Caching must be enabled for this URL. See the <code class="directive"><a href="/mod/mod_cache.html#cacheenable">CacheEnable</a></code> and <code class="directive"><a href="/mod/mod_cache.html#cachedisable">CacheDisable</a></code> directives.</li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>The response must have a HTTP status code of 200, 203, 300, 301 or
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>If the request contains an "Authorization:" header, the response
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose will not be cached.</li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>If the response contains an "Authorization:" header, it must
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose also contain an "s-maxage", "must-revalidate" or "public" option
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose in the "Cache-Control:" header.</li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>If the URL included a query string (e.g. from a HTML form GET
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose method) it will not be cached unless the response includes an
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose "Expires:" header, as per RFC2616 section 13.9.</li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>If the response has a status of 200 (OK), the response must
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose also include at least one of the "Etag", "Last-Modified" or
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose the "Expires" headers, unless the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="directive"><a href="/mod/mod_cache.html#cacheignorenolastmod">CacheIgnoreNoLastMod</a></code>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose directive has been used to require otherwise.</li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>If the response includes the "private" option in a "Cache-Control:"
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose header, it will not be stored unless the
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <code class="directive"><a href="/mod/mod_cache.html#cachestoreprivate">CacheStorePrivate</a></code> has been
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose used to require otherwise.</li>
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose <li>Likewise, if the response includes the "no-store" option in a
f69f3581658351003a6d9245045e41d0efb85022Sumit Bose "Cache-Control:" header, it will not be stored unless the
<code class="directive"><a href="/mod/mod_cache.html#cachestorenostore">CacheStoreNoStore</a></code> has been
<code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> when requesting content by the backend it
<code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> will detect the headers attributed in the
<p><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> will only serve the cached content to
<p>Using <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> is very much like having a built
<code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> makes no decision about whether a cached
<code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> has cached some content, it will be served
by using the <code class="directive"><a href="/mod/mod_cache.html#cachedisable">CacheDisable</a></code>
directive, or <code class="module"><a href="/mod/mod_expires.html">mod_expires</a></code>. Left unchecked,
<code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> - very much like a reverse proxy - would cache
using <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code>, it is relatively easy to
using <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> you should bear this in mind -
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code></li><li><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_file_cache.html#cachefile">CacheFile</a></code></li><li><code class="directive"><a href="/mod/mod_cache.html#cacheenable">CacheEnable</a></code></li><li><code class="directive"><a href="/mod/mod_cache.html#cachedisable">CacheDisable</a></code></li></ul></td></tr></table>
caching provided by <code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code>. Rather than caching
<p>Although using <code class="directive"><a href="/mod/mod_file_cache.html#cachefile">CacheFile</a></code>
<p><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> also provides its own file-handle
<code class="directive"><a href="/mod/mod_cache.html#cacheenable">CacheEnable</a></code> directive.</p>
<p>As with all of <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> this type of file-handle
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code></li><li><code class="module"><a href="/mod/mod_file_cache.html">mod_file_cache</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_cache.html#cacheenable">CacheEnable</a></code></li><li><code class="directive"><a href="/mod/mod_cache.html#cachedisable">CacheDisable</a></code></li><li><code class="directive"><a href="/mod/mod_file_cache.html#mmapstatic">MMapStatic</a></code></li></ul></td></tr></table>
<code class="directive"><a href="/mod/mod_file_cache.html#mmapstatic">MMapStatic</a></code> directive, which
<code class="directive"><a href="/mod/mod_file_cache.html#cachefile">CacheFile</a></code> directive, any
<p><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> provides a HTTP-aware intelligent
<code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> may still be able to perform caching.</p>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_cache.html#cacheenable">CacheEnable</a></code></li><li><code class="directive"><a href="/mod/mod_cache.html#cachedisable">CacheDisable</a></code></li></ul></td></tr></table>
<p><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> provides a disk-based caching mechanism
for <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>. As with <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code>
<p>To store items in the cache, <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> creates
the <code class="directive"><a href="/mod/mod_disk_cache.html#cachedirlevels">CacheDirLevels</a></code> and
<p><code class="directive"><a href="/mod/mod_disk_cache.html#cachedirlevels">CacheDirLevels</a></code>
for <code class="directive"><a href="/mod/mod_disk_cache.html#cachedirlength">CacheDirLength</a></code>
<p>Although <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> will remove cached content
<p>Instead, provided with Apache is the <a href="programs/htcacheclean.html">htcacheclean</a> tool which, as the name
<p>Because <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> does not itself pay attention
<p><span>Available Languages: </span><a href="/en/caching.html" title="English"> en </a></p>
<p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>