How to Add Expiry Header In WordPress Website

How to Add Expiry Header In WordPress Website:

Hello guys, we are here with another blog. It will help you a lot I hope. If you are facing this issue then no need to worry.

We will help you with short blog without any delay.

There are few steps you need to do before you set this problem.

Step 1:

You need to first copy this code which is in HTML form.

If you are looking for detailed information then click here

<ifmodule mod_expires.c="">
  ExpiresActive On
  # Images
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"
  # Video
  ExpiresByType video/mp4 "access plus 1 year"
  ExpiresByType video/mpeg "access plus 1 year"
  # CSS, JavaScript

 ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  # Others
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType application/x-shockwave-flash "access plus 1 month"

Alternative method:

You can add this code without any worrying. You just need to install W3 Total cache

This plugin will automatically add this code in root directory.

If you have still queries then comment us.

Leave a Reply

Your email address will not be published. Required fields are marked *