Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,627 members, 7,813,063 topics. Date: Tuesday, 30 April 2024 at 06:06 AM

Leverage Browser Caching Is Affecting Your Wordpress Website/blog - Solution - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Leverage Browser Caching Is Affecting Your Wordpress Website/blog - Solution (621 Views)

How To Leverage Browser Caching Of Your Website To Improve Page Load Speed / How To Optimize Wordpress Performance With Redis Caching / 7 Steps To Reduce The Disc Space Used By Your Wordpress Website (2) (3) (4)

(1) (Reply)

Leverage Browser Caching Is Affecting Your Wordpress Website/blog - Solution by WordpressPhysco: 2:50pm On Jul 08, 2019
iT'S ME. The Wordpress guy



On my recent session here - https://www.nairaland.com/5283574/research-shows-lose-more-money

, I talked about how to make your website super-fast, or at least see what makes Nairaland first page thick - super fast. Today, I want to discuss one of the factors that make a website/blog dull.

#1. Leverage Browser Caching

What is browser caching?

Every time a browser loads a webpage it has to download all the web files to properly display the page. This includes all the HTML, CSS, JavaScript and images.

Some pages might only consist of a few files and be small in size – maybe a couple of kilobytes. For others however there may be a lot of files, and these may add up to be several megabytes large. Twitter.com for example is 3 MB+.

The issue is two fold.
1. These large files take longer to load and can be especially painful if you're on a slow internet connection (or a mobile device).
2. Each file makes a separate request to the server. The more requests your server gets simultaneously the more work it needs to do, only further reducing your page speed.

Browser caching can help by storing some of these files locally in the user's browser. Their first visit to your site will take the same time to load, however when that user revisits your website, refreshes the page, or even moves to a different page of your site, they already have some of the files they need locally.

This means the amount of data the user's browser has to download is less, and fewer requests need to be made to your server. The result? Decreased page load times.

How does it work?

Browser caching works by marking certain pages, or parts of pages, as being needed to be updated at different intervals. Your logo on your website, for instance, is unlikely to change from day to day.

By caching this logo image, we can tell the user's browser to only download this image once a week. Every visit that user makes within a week would not require another download of the logo image.

By the web server telling the browser to store these files and not download them when you come back saves your users time and your web server bandwidth.

How to leverage browser caching
Configuring your Apache to serve the appropriate headers

By adding the following codes to your .htaccess file in the root of your domain.

[b]Note: [/b]contact your webmaster if you can’t do it | Back up your system.

<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"
</IfModule>



When done, make sure to save it and exit.

p.s: you can contact me (bizdynamicx@gmail.com) if you need help to make your WORDPRESS website fast.


Recent project -http://myprojectacademy.com.ng

Note: I WON'T CHARGE YOU. Freeeeeeeeeee wink

(1) (Reply)

Mythemeshop.com Premium Wordpress Theme And Plugins Available At Moi Moi Rate / Reasons You Should Host With Qservers / Web 2.0 Sites List

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.