If you are running a website and your website loads slowly, you are losing visitors every day. It’s time to do speed up WordPress website. I will show you how I got a 95+ score in GTmetrix and website loading speed less than 2 sec. This method is the easiest and quick method of optimization of the WordPress website.
Table of Content – How to speed up WordPress site
Before going to speed optimization let’s learn about the importance of website speed optimization.
In this tutorial, we will use a website called CMSN POS. Let’s test this website speed on GTmatrix.
As we can see this website page loading speed is 50% and the Yslow score is 63%. End of this case study we will speed up this website speed more than 95+.This website made by WordPress.Let’s began this WordPress website speed up. Before going to start we have to see Gt-matrix recommendation.
Gt-matrix shows two recommendation. Server Scaled images and Leverage browser caching.If you solve these two issues.This website will be load faster.Let’s see which images need to optimize.
Images Optimization :
If your web page contains lots of images. Now it’s time to resize and optimize them. How we will do image optimization. There is a couple of ways to do this. Go to Gtmetrix and test your website. You might be seen under the server scaled images there are a couple of images need to optimize. As you can see this website contains an image’s size of 1080*1080 and Gtamtrix suggested make it 512*512.If we do this 77% images size will be reduced. We can resize these images easily.
How to resize images in the WordPress dashboard :
Login to the WordPress admin panel and go to > media and find the images. After that click on scale and full 510. It will automatically calculate by 510*510. You can resize other images following this instruction.
Here are pro tips for images optimization:
Don’t upload png format images on your website. Png format images size much larger than jpg format. Before uploading any image on your website. Compress image first using Compressjpg. Please follow this step on how you can do image optimization.
If your image format is png then convert it into jpg.
Leverage Browser Caching :
When a visitor visits your website, the browser stores your web pages on the visitor’s local computer. This is called caching. There are a couple of ways to do this. You may couple caching plugin. Now I will show how you can reduce leverage browser caching, This thing will help your WordPress speed optimization.
Change the request headers of your resources to use caching editing .htaccess file. Paste the below code top of the .htaccess file. This method is called the header expires method.
Be careful :
You have to be careful when enabling browser caching for speed up WordPress website, as if you set the parameters too long on certain files, users might not be getting the fresh version of your website after updates.
Now paste the below code into your website .htacss file.
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”
ExpiresByType video/mp4 “access plus 1 year”
ExpiresByType video/mpeg “access plus 1 year”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access plus 1 month”
Method 2 :
Quick cache control paste this code top of the header.
# 1 Month for most static assets
Header set Cache-Control “max-age=2592000, public”
Use a Content Delivery Network (CDN):
Content Delivery Network will help you to load your website faster.CDN helps your visitor to retrieve his/her requested data from the nearest server. Let’s see how CDN works for website speed optimization. If your website located service in the USA and your visitor trying to visit your website from Europe.How CDN helps your visitor to see your website as fast as possible. When visitors sent a request to browse your website then CDN retrieved your website data from the nearest server (Where already your static data like HTML, CSS, images loaded).
There are a couple of Content Delivery Network service providers. Try them. You can also take a look at our Best CDN providers reviews.