Hi,

This requires some amount of development work. We added an additional header to the response header, X-Cache-Stat. In file mod_cache.c, the following changes were made. The actual line numbers may differ depending on your version of the code.


465a477,480
>         /*mbenjamin: TCP_MISS*/
>         if (!apr_table_get(r->headers_out, "X-CacheStat"))
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS_VERIFY");
>
492a508,511
>         /*mbenjamin: TCP_MISS*/
>         if (!apr_table_get(r->headers_out, "X-CacheStat"))
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS_NOSTORE");
>
503c522,526
<     }
---
>             /*mbenjamin: TCP_MISS*/
>         if (!apr_table_get(r->headers_out, "X-CacheStat"))
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS_PRIVATE");
>
> }
514a538,541
>         /*mbenjamin: TCP_MISS*/
>         if (!apr_table_get(r->headers_out, "X-CacheStat"))
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS_AUTH_FAILED");
>
530a558,560
>         /*mbenjamin: TCP_MISS*/
>         if (!apr_table_get(r->headers_out, "X-CacheStat"))
>             apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS");
606a637
>
607a639,647
>             /*mbenjamin: TCP_HIT_VERIFY*/
>             if(!apr_table_get(r->headers_out, "X-CacheStat")) {
>             if(strstr("mem", cache->provider_name)) {
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_HIT_VERIFY_MEM");
>             }else{
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_HIT_VERIFY_DISK");
>                     }
>                 }
>
621a662,664
>             /*mbenjamin: TCP_MISS_VERIFY*/
> apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS_VERIFY");
>
629a673,677
>
>         /*mbenjamin: TCP_MISS*/
>     if (!apr_table_get(r->headers_out, "X-CacheStat"))
>             apr_table_setn(r->headers_out, "X-CacheStat", "TCP_MISS");
>

Then as a final step you configure the access log format in httpd.conf to log the value of the X-CacheStat header.

hope this helps.

Thanks,
Manik

Andrew Dixon wrote:
Hi Manik,

Can you explain how you did this?

Thanks

Andrew

2008/11/5 Manik Taneja <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>

    Andrew Dixon wrote:

        Hi All,

        I have enabled mod_cache and I'm using mem caching
        (mod_mem_cache) as my caching type, but how can I check if it
        is actually doing anything. Is there anyway to see what is in
        the cache, being served from the cache, what the cache hit
        rate is, etc...???

    There isn't a way, at least as of apache 2.2.9. <http://2.2.9.> We
    had a similar problem but i modified the status code that gets
    logged to apache logs to indicate is the 200OK/302 was a result of
    a cache-hit.
    -M

        Thanks

        Kind regards,

        Andrew.



    ---------------------------------------------------------------------
    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: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
     "   from the digest: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    For additional commands, e-mail: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>




---------------------------------------------------------------------
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: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to