WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
How to properly insert mod_expires rules? (2 posts)

  1. donsekkle
    Member
    Posted 2 years ago #

    Hi,

    can somebody please tell me how to properly insert mod_expires rules into my wordpress .htaccess file when using WP Super Cache.

    Should I add the code to both htacces files? (The original and the cached directory's one?)

    Where exactly do i place the code?

    This is the code i would like to try, is it ok?

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/gif "access plus 1 week"
    ExpiresByType image/png "access plus 1 week"
    ExpiresByType image/jpg "access plus 1 week"
    ExpiresByType image/jpeg "access plus 1 week"
    ExpiresByType image/ico "access plus 1 week"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    </IfModule>

    Thanks in advance!

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. donsekkle
    Member
    Posted 2 years ago #

    This is my .htaccess file code

    [Code moderated as per the Forum Rules. Please use the pastebin]

    and my .htaccess in wp-super-cache directory:

    # BEGIN supercache
    <IfModule mod_mime.c>
      <FilesMatch "\.html\.gz$">
        ForceType text/html
        FileETag None
      </FilesMatch>
      AddEncoding gzip .gz
      AddType text/html .gz
    </IfModule>
    <IfModule mod_deflate.c>
      SetEnvIfNoCase Request_URI \.gz$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
      Header set Vary "Accept-Encoding, Cookie"
      Header set Cache-Control 'max-age=3, must-revalidate'
    </IfModule>
    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType text/html A3
    </IfModule>
    
    # END supercache

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic