0

I have a domain like images.example.com served from Apache server. The requests that go there currently are images that are drawn using server-side language (PHP) and are cached on the application side but it seems like huge overhead to me.

Is there an easy way (Apache module) to cache every request that goes to images subdomain so that it doesn't reach the PHP at all, if it's still in the cache?

1 Answer 1

0

Apache does include the mod_cache module, which implements RFC2616 compliant caching. You'll need to ensure that your PHP script sets appropriate Expires headers in its responses. Your config should look something like this:

LoadModule cache_module modules/mod_cache.so LoadModule cache_disk_module modules/mod_cache_disk.so <Location /images> CacheRoot /var/cache/apache/sitename/images CacheEnable disk </Location> 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.