Adding expiry dates to your headers can significantly improve the performance of your website and is a great way to make WordPress faster.
In this quick post, I’m going to give you the add expires headers htaccess code to use on your htaccess file.
I’ll also walk you through it in the video below.
If you’re a WordPress user, doing it this way will save you having to use a plugin.
The downside of doing it this way is that you have to remember to edit the file and change the expiry dates when those dates are ‘up’, and unless you’re on the meticulous side, that’s an easy thing to forget, especially if you’re dealing with multiple websites.
[clickToTweet tweet=”Tweaking your website’s performance on an ongoing basis is part and parcel of being a website owner.” quote=”Tweaking your website’s performance on an ongoing basis is part and parcel of being a website owner.” theme=”style3″]
So let’s do the usual prep stuff:
- backup your website
- download a copy of your htaccess file
[clickToTweet tweet=”Manually backing up your website is the least sexy task in WordPress, but a screwed up LIVE site is sheer hell.” quote=”Manually backing up your website is the least sexy task in WordPress, but a screwed up LIVE site is sheer hell.” theme=”style3″]
Once you’ve got that out the way, here’s all you do:
- Step 1: edit your htacess file and paste the code below.
- Step 2: press save.
- Step 3: check your website hasn’t exploded.
And here’s the code:
Add Expires Headers htaccess code
Header set Expires “Mon, 4 Nov 2018 21:00:00 GMT”
Header unset ETag