How do I verify Apache caching is working?

apache, apache2, caching, httpd.conf

Solution

You can check if your apache is really caching content or not by confirming below points.

check size of /var/cache directory. It should be growing in size after some time when there is hit on your apache

You can check in logs, there should response code 302 instead of 200.

If you match both these points then there should be working mod_disk_cache module.

Problem

I've added the cache directives to my httpd.conf file but cannot discover how to verify it's actually caching the pages and serving them up. How can I verify this? I added the cache directives at the server config level (not using VirtualHost) as: ``` CacheEnable disk / CacheRoot /var/cache CacheDefaultExpire 3600 ```

Original source