In this post, I will tell you how to reduce page loading time from 9 to 2-3 seconds!
Just follow the tutorial instructions, and that’s it!
Time Required: 15 minutes.
Before continuing, please take a full backup of your blog.
When I noticed the page loading times, I first looked at the options. I had used WP Super Cache before but did not have good experiences with it. So, I decided to give W3 Total Cache a try.
You can get the plugin from WordPress Plugin Directory here. For now, enable Page Caching, Minify and Database Caching and leave CDN integration as we are going to do that later. Here's a short description of what these options do:
Default settings of the plugin are good to go by, and the only thing you need to do is enable database caching.
Now, W3 Total Cache is all set.
After setting up the plugin, out loading times fell to 6-7 seconds - okay but still a bit slow. So, we decided to use Amazon's CloudFront as CDN for fast delivery of images. This leaves our server with the task of handling PHP and SQL only and makes it super-fast.
Why CDN Is Important: Before doing anything, you should know why it is needed and how it works! Here's an example that will relate to everyone!
Think of your blog as a math teacher and you as a server! Remember when you were in seventh grade and the teacher gave you those lengthy "statement" questions which were difficult to understand initially but had fewer calculations? Wouldn't it have been simple if you had a friend that would convert all the statements for you
First, sign up for Amazon Web Services account here. Now, you need to decide between CloudFront and Simple Storage Service. Here's a brief description of how they work:
You need a credit card to sign for S3 and CloudFront.
Now, go to your AWS Management Console and go to your account. Click "Security Credentials". Under access credentials, you will see your access keys. Click "Show Secret Key" and note both the keys (access key id and secret access key) values down.
Also, create a new bucket in S3 console.
A bucket is a storage location for all your files. To create a bucket, sign into Amazon Management Console and switch to Amazon S3 tab. Create a bucket. You can name it anything as long as it is available.
Now, either you can use S3 straightaway or signup for CloudFront. I recommend signing up for CloudFront as it has the same pricing as S3 and will provide an excellent boost without adding many costs!
If you want to use S3 only, skip the following step.
First, sign up for CloudFront. Next, click “Create Distribution”.
Select “Download” as delivery method and select the bucket that you just created as the origin.
You can enter custom CNAMEs if you want. CNAMEs allow you to use your own sub-domain for CDN (like we use cdn.bloggingwithsuccess.net) and click “Create”.
If you want a custom CNAME, follow the following steps:
Now your Content Delivery Network is all set, and you need to configure the W3 Total Cache plugin correctly.
Go to Settings? W3 Total Cache and then click Content Delivery Network in the plugin menu.
Now, you will see options to host different files on CDN. Here’s what each option does:
I’d recommend hosting wp-includes and custom files (including WP gallery) because this is the central part of your blog. If you are not a frequent theme customizer, you can also host theme files.
Now, enter the access key id and secret key and other information (bucket name for using Amazon S3 and CNAME for CloudFront).
Export the required files by clicking the corresponding button. The process will be fast.
Now check the images of your blog. If their source is not cdn.yourdomain.com (or CNAME you chose), the process is successful!
Well, take some time off and enjoy your faster blog! Jamon!
Subscribe to our newsletter and access exclusive content and offers available only to MonsterPost subscribers.