Set HTTP Response Header Cache-Control and enable mod_cache for higher performance

Posted by eichelgartenweg on 2:12 PM with 3 comments
To enable the ability of caching of pictures open the httpd.conf of your IBM HTTP Server and add following lines

LoadModule headers_module modules/mod_headers.so

<Location ~ "\.(jsgifjpgjpegpngjpe)$">

Header add Cache-Control "public, max-age=432000, post-check=172000"

</Location>

These lines enable the module mod_headers.so and are setting a Cache-Control header. A Cache-Control header enables clients, webservers and proxys to cache pictures.

Adding the Cache-Control-Header is very useful for older Liferay-Versions.

To enable a IBM HTTP Server to cache those pictures add additionally these lines:

LoadModule cache_module modules/mod_cache.so

LoadModule mem_cache_module modules/mod_mem_cache.so

<IfModule mod_mem_cache.c>

CacheEnable mem /

MCacheSize 4096

MCacheMaxObjectCount 100

MCacheMinObjectSize 1M

CacheMaxObjectSize 2048

</IfModule>

Link to sample httpd.conf