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

  1. donsekkle
    Posted 4 years ago #


    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"

    Thanks in advance!


  2. donsekkle
    Posted 4 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
      AddEncoding gzip .gz
      AddType text/html .gz
    <IfModule mod_deflate.c>
      SetEnvIfNoCase Request_URI \.gz$ no-gzip
    <IfModule mod_headers.c>
      Header set Vary "Accept-Encoding, Cookie"
      Header set Cache-Control 'max-age=3, must-revalidate'
    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType text/html A3
    # END supercache

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic