Improve Plone-based website performance with simple Apache caching

I won't go too much into details, and this is more for my own personal reference, but using this short recipe I was able to increase by up to 100 times the performance of a plone based website. For a lot more details and more advanced techniques for caching, integration with squid and cachefu, visit the Plone documentation HowTo section.

The website hosts mostly news updates, and is edited mostly by an editorial staff, under a 24 hours cycle. The configuration file is extremely simple and can be droped in for any website that has a similar profile (or any website that has a closed editorial staff)

Requirements: apache 2 + mod_disk_cache + mod_expires

    <LocationMatch "^[^/]">
        Deny from all
    </LocationMatch>

    <IfModule mod_disk_cache.c>
        CacheEnable disk /
        CacheRoot /var/cache/http
        CacheSize 5
        CacheMaxExpire 24
        CacheLastModifiedFactor 0.1
        CacheDefaultExpire 3
            #expires in 3 hours
        CacheGcInterval 3
            #check each hour the cache and delete the obsolete files
    </IfModule>

    <IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
    </IfModule>

    ExpiresActive On
    ExpiresByType image/gif A10800
    ExpiresByType image/png A10800
    ExpiresByType image/jpeg A10800
    ExpiresByType text/css A10800
    ExpiresByType text/javascript A10800
    ExpiresByType application/x-javascript A10800
    ExpiresByType text/html A10800
    ExpiresByType text/xml A10800


Comments