Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Expired Headers

nets to go in .htaccess

# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------

<IfModule mod_expires.c>
  ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault                          "access plus 1 week"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
  ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html
  ExpiresByType text/html                 "access plus 0 seconds"

# Data
  ExpiresByType application/json          "access plus 0 seconds"
  ExpiresByType application/xml           "access plus 0 seconds"
  ExpiresByType text/xml                  "access plus 0 seconds"

# Feed
  ExpiresByType application/atom+xml      "access plus 1 hour"
  ExpiresByType application/rss+xml       "access plus 1 hour"

# Favicon (cannot be renamed)
  ExpiresByType image/x-icon              "access plus 1 week"

# Media: images, video, audio
  ExpiresByType audio/ogg                 "access plus 1 week"
  ExpiresByType image/gif                 "access plus 1 week"
  ExpiresByType image/jpeg                "access plus 1 week"
  ExpiresByType image/png                 "access plus 1 week"
  ExpiresByType video/mp4                 "access plus 1 week"
  ExpiresByType video/ogg                 "access plus 1 week"
  ExpiresByType video/webm                "access plus 1 week"

# HTC files  (css3pie)
  ExpiresByType text/x-component          "access plus 1 week"

# Webfonts
  ExpiresByType application/vnd.ms-fontobject "access plus 1 week"
  ExpiresByType application/x-font-ttf    "access plus 1 week"
  ExpiresByType application/x-font-woff   "access plus 1 week"
  ExpiresByType font/opentype             "access plus 1 week"
  ExpiresByType image/svg+xml             "access plus 1 week"

# CSS and JavaScript
  ExpiresByType application/javascript    "access plus 1 week"
  ExpiresByType text/css                  "access plus 1 yweek"

</IfModule>