]> granicus.if.org Git - apache/commitdiff
Adding an cache hit/miss example, regarding PR#48241
authorIgor Galić <igalic@apache.org>
Thu, 22 Apr 2010 12:07:44 +0000 (12:07 +0000)
committerIgor Galić <igalic@apache.org>
Thu, 22 Apr 2010 12:07:44 +0000 (12:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@936805 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/logs.html.en
docs/manual/logs.xml

index 3fe64e2539a876509f6e871ce85f4e25c2c5a0fc..9711bdf68042170a6cc96cf2cb995107fb727e15 100644 (file)
         CustomLog logs/non_english_log common env=!english
       </code></p></div>
 
+      <p>In a caching scenario one would want to know about
+      the efficiency of the cache. A very simple method to
+      find this out would be:</p>
+
+      <div class="example"><p><code>
+        SetEnv CACHE_MISS 1<br />
+        LogFormat "%h %l %u %t "%r " %&gt;s %b %{CACHE_MISS}e" common-cache
+        CustomLog logs/access_log common-cache
+      </code></p></div>
+
+      <p><code class="module"><a href="./mod/mod_cache.html">mod_cache</a></code> will run before
+      <code class="module"><a href="./mod/mod_env.html">mod_env</a></code> and when successfull will deliver the
+      content without it. In that case a cache hit will log
+      <code>-</code>, while a cache miss will log <code>1</code>.</p>
+
       <p>Although we have just shown that conditional logging is very
       powerful and flexible, it is not the only way to control the
       contents of the logs. Log files are more useful when they
index 677ab847a62671c7332ff3c76da7628d62ecd4b9..d85e966c181b2869902f26588ac1d928aac1f2f4 100644 (file)
         CustomLog logs/non_english_log common env=!english
       </example>
 
+      <p>In a caching scenario one would want to know about
+      the efficiency of the cache. A very simple method to
+      find this out would be:</p>
+
+      <example>
+        SetEnv CACHE_MISS 1<br />
+        LogFormat "%h %l %u %t "%r " %>s %b %{CACHE_MISS}e" common-cache
+        CustomLog logs/access_log common-cache
+      </example>
+
+      <p><module>mod_cache</module> will run before
+      <module>mod_env</module> and when successfull will deliver the
+      content without it. In that case a cache hit will log
+      <code>-</code>, while a cache miss will log <code>1</code>.</p>
+
       <p>Although we have just shown that conditional logging is very
       powerful and flexible, it is not the only way to control the
       contents of the logs. Log files are more useful when they