Re: Questions on Apache Caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 12, 2012 at 1:15 PM, Bhattacharya, Sudip
<sudip.bhattacharya@xxxxxxxxxxx> wrote:
> I am using mod_cache module to enable caching of certain subfolders in VirtualHost section which is mapped to proxy requests to a remote server.
>
> Is there any way to log requests specific to cached files? I want to know:
> 1. Which files are actually getting cached
> 2. How many requests are actually getting served from local cache. Effectively how much bandwidth I am saving by serving files from local cache.
> 3. Is it possible to avoid the default folder structure of the caching, and get a mirror structure instead of the remote path/folder/file structure instead?
> 4. Is it possible to enable caching for specific file extensions, or by MIME type
>

In 2.2 you can alter the access log to output the handler that handled
the request (the format for this is %R) - when an item is returned
from the cache the handler will be empty.

In 2.4 you can add set "CacheHeader on", and each response will have a
"X-Cache" header added to it that says whether it was a hit or not,
which can then be logged.

You cannot alter the cache file structure in that manner. However, if
you can synchronise all these files from the backend to the cache, you
could then only proxy to the backend if the file is not present on the
frontend. This would require manual synchronisation of files on both
sides.

Whether a resource is stored in the cache or not depends upon the
headers that the response has. See the section labelled "What Can be
Cached" here:

http://httpd.apache.org/docs/2.2/caching.html

If you don't want a particular resource to be cached, or vice-versa,
set appropriate response headers. "Cache-Control: private" would allow
the client receiving the resource to cache it, but not your apache
cache, nor any intermediate cache between there and the client.

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux