Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've installed Apache's mod_mem_cache on a server that serves multiple websites. I needed to install it in a hurry as I had a massive traffic spike and was firefighting. It has improved performance massively and all of my sites seem to be serving the correct content, all is well, but I have two questions:

  1. How do I restrict the content types that are cached? Ideally I'd like to cache just css|js|jpg. I tried a <FilesMatch> within the mod_mem_cache.conf but that didn't work.

  2. Is there any way to see which files are in the cache at any point?

share|improve this question
    
It's been removed from Apache 2.4 so I wouldn't get too attached to it, or spend too much time learning how to configure it. Look into disk caching. –  EJP Aug 22 '12 at 12:19
    
Or look in to Varnish. –  pjmorse Sep 18 '12 at 23:50

2 Answers 2

The answer above is pretty good but...

Personally I would skip mod_mem_cache and install Varnish IMO a much better tool for the job and comes with some very useful debugging and metrics. Put varnish on port 80 and apache on 8080 or another used high level port.

https://www.varnish-cache.org

share|improve this answer
  1. http://www.askapache.com/htaccess/apache-speed-cache-control.html
  2. Default path is /var/cache/apache/ (http://httpd.apache.org/docs/2.2/caching.html)
share|improve this answer
    
Hi japao, thanks for the comment but that wasn't exactly what I was looking for. /var/cache is the mod_disk_cache location and the askapache article seems to be talking about cache headers that are sent to the browser. –  Steve Claridge Aug 21 '12 at 9:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.