Two ways to set Expires headers

There are two ways to set Expires headers. The first is by manually adding the code snippet in .htaccess as I show in the Expires headers video. The second is by setting up Browser Caching in your caching plugin, which will also add code in .htaccess.

Not every caching plugin has this option and while in some it's automatic, in others the option needs to be enabled. WP Fastest Cache which I featured in the tutorial, W3 Total Cache, and WP Rocket will set Expires for you.

If your host provides you with a caching solution (you'll find it in your WP admin dashboard if they do), then check to see if it sets Expires. If it doesn't, then add the code manually. At the end you want to have just one set of Expires in your .htaccess.

On the Nginx servers, Expires are set at the server level and enabled by default on most modern hosts.

We use cookies for your best experience.