We all know that faster websites are better websites. Not necessarily better quality, as the Internet is full of drivel, but Google and Bing love fast websites. If you can serve fast content, they’ve openly admitted you’ll do better in their search rankings. Better ranking means more readers/subscribers/buyers/moneys. It’s meant an improvement for this WordPress blog of mine. One of the main things that slows down web pages being served, is sending the user the same data every time they visit a page. This is where Leverage Browser Caching comes into play.
Leverage Browser Caching explained
Reading that paragraph above, you may say to yourself that every page you serve your readers contains different content. Different articles, or products, or pictures of cats doing daft things. The fact is though, your content usually makes up only a small portion of the data transferred.
When the visitor goes from one page to another, your nice consistently styled website means your header images, footer code and common pictures are asked for each page view. This is where Browser Caching comes in!
Browser Caching basically means the servers tells your users’ browser –
If you’ve already got this image, it wont have changed in the last week, so don’t bother asking me for it again
Less data to transfer = faster site,
Faster site = Happier search engines
Happier search engines = Happier you!
(You can read more about improving your sites speed here)
How to easily leverage browser caching
Thankfully implementing browser caching can be easy, even for shared hosting. My shared hosting is with Heart Internet, and they thankfully have recently (within the last 6months I think) added the mod_expires module to Apache.
If your hosting doesn’t have mod_expires enabled by default, drop them a support ticket and they should add it for you (fingers crossed).
What you need to do is open your .htaccess file in your root directory. If you don’t have one, simply add it making sure you add the full-stop before the file name.
Add the following:
Save that htaccess file and thats it!
To test whether its worked, enter your website in this Google PageSpeed Insight tool and you should see a green tick beside the Leverage Browser Caching.
This should pull your load times right down which is excellent for nothing less than 10 minutes work. Let me know how much your times change, it’ll be good to the improvements.