WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] mod_expires & mod_headers config for WP Super Cache (2 posts)

  1. Lumpysimon
    Member
    Posted 3 years ago #

    I've got a VPS to run a few WordPress sites, each using WP Super Cache in mod_rewrite mode.

    I'm just wondering what are the best config settings to use with the mod_expires and mod_headers Apache modules so they work optimally with WP Super Cache?

    Here's what I've got at the moment, I'm keen to know if these settings are good or could be improved:

    # Turn on Expires and set default to 0
    ExpiresActive On
    ExpiresDefault A0
    
    # cache media files for 30 days
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
    ExpiresDefault A2592000
    Header append Cache-Control "public"
    </FilesMatch>
    
    # cache image/flash files for 30 days
    <FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
    ExpiresDefault A2592000
    Header append Cache-Control "public"
    </FilesMatch>
    
    # 1 hour caching for commonly updated files
    <FilesMatch "\.(xml|txt|html|js|css)$">
    ExpiresDefault A3600
    Header append Cache-Control "proxy-revalidate"
    </FilesMatch>
    
    # No caching for dynamic files
    <FilesMatch "\.(php|cgi|pl|htm)$">
    ExpiresActive Off
    Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform
    Header set Pragma "no-cache"
    </FilesMatch>

    Any advice is much appreciated,
    Simon

  2. Lumpysimon
    Member
    Posted 3 years ago #

    aha - i've just noticed there's a link to askapache from the wp super cache page to an almost identical file, so that answers my question!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic