fbpx

The need for Speed — A WordPress Story

The need for Speed — A WordPress Story

Every site owner wants to increase their site speed and drive traffic. There are various factors that determine your search engine rankings and the time it takes to load (site speed) is definitely one of them. There are many WordPress optimizations you can use to boost your site speed and performance. You have to realize most site visitors will wait for less than two seconds for the site to load. If it takes more than two seconds they will grow impatient and move on. Below are some tools you can use, and different ways to optimize your WP site.

Tools for measuring site speed

Google page speed insight

Speed insight is one of the best tools for measuring site speed and determining its load time. Just go here https://developers.google.com/speed/pagespeed/ and type the URL you want to measure into the on screen box and click on the analyze button to get the results. The scores on the PageSpeed ranges from 0–100 points; if the score is 85 and above then your site is performing fairly well. PageSpeed helps to determine how the page can improve its performance on time it takes for full page load, and time to above the fold load. You will also get advice on solving page speed issues.

GTMetrix

GTMetrix is another tool that helps to measure site speeds. It is used to figure out how long a link/page takes to load. Just go to this URL https://gtmetrix.com/ and type the URL into the on screen box then click on the ‘go’ button. You will get a report on different aspects of the site load times. The great thing about GETmetrix is it offer the finding from several tools such as Google Page, Yslow all in one place.

Pingdom

Pingdom features a site speed test tool. To use this tool, enter your URL in the on screen box, click on test now. You get a report divided into various sections (a performance grade, page analysis and waterfall analysis. It also assists in determining the most important causes of site slowdown and how to solve them.

Improving your sites speed

Streamline the homepage

Its frequently the most visited page of the site, you can determine that for sure by looking at your analytics. Ive seen lots of sites where 90% + of entry visits came into the homepage.

Minimizing HTTP Requests

The more the page contents the longer it takes to load. Therefore the quickest way to speed up your page speed is simplifying your page design. Let go some images or use CSS instead of them, also you can modify some scripts and put them in the footer.

Enable compression

Large pages (100kb or more) are usually bulky and very slow to download. The best way to increase the speed in such cases is enabling compression. Compression reduces HTTP response due to reduction of pages bandwidth. Gzip is the best tool for compressing your pages

Reduce server response time

You should target to have a serve response time of less than 200 milliseconds. If you use a web monitoring solution such as hardenedwp.com you can monitor this target. You can also keep checking for bottlenecks in performance using Yslow or PageSpeed tools from Google to achieve this.

Image optimization

Large image size will cause your site to slow. Its crucial to figure out the best way to compress it. You can use a tool like EWWW Image Optimizer and WP Smush automatically optimizes your images as you load them to your website. The good thing about this tool is that it can also optimize previously uploaded images. EWWW has the ability to convert your images to file format with smallest size images.

Database optimizations

Database optimization is another way to effect site speed. To keep your site speed as fast as possible, you need to keep an eye on your post trash, post revisions, pages comment or any kind of unwanted data. Too much stale data on your site can cause slow loading,

Upgrade to PHP 7

Upgrading to PHP 7 would be a good idea for your site. This version has great features, huge performance improvements, free to use and better security. What are the benefits of upgrading to PHP 7? The following are advantages of upgrading to PHP 7;

  • Improved performance
  • Great password hashing features
  • Built in web server for testing purposes
  • Improves your site speed

CDN

CDN is a crucial component for any serious site. What is CDN? CDN is a global web server whose main purpose is to provide highly available content and faster delivery. This helps in preventing delay as the user is provided with the content he/she need at any given time or place. With CDN the content is replicated so that it may exist in several places at the same time. An option that wont break the bank is cloud flare. You can also host your images on a 3rd party service like flickr, dropbox or use external comment systems like disqus. Keep in mind hosting your files on free external services might have some SEO implications because most of them hash the file url, name.

Minify and Optimize CSS and JS

If your site has to load numerous files such as JavaScript, CSS and HTML. The best way to speed up your code is to minify and optimize it. What does minify means? Minify means removal of any unneeded characters that are not required for the code to run. WordPress minify allows you to bring CSS and JS flies together and minify them, which will in turn improve your site load speed. Also dont leave a bunch of unused code or CSS. Just wasteful 🙂

AMP Pages

Accelerated Mobile Pages (AMPs) has been associated with fast site speed and higher ranking for some time now. AMP is an open sourced coding standard for publishers with an aim to help them to be able to load their site as quick as possible on mobiles. More on this later I’ve got a couple of webinars coming up on this topic specifically.

Caching

Caching is one of the easiest ways speed up yourt WP site. Caching effectively decreases your server’s load time by creating static and HTML files and saving them for future use. Caching is done in two ways browser caching and WordPress caching. WordPress caching is configured on your WordPress website via the use of a caching plug-in.

Lazy loading

When lazy loading is done right it can speed up your site speed. Every website visitor wants a lightning- fast website, and in case the site speed is very slow your visitors will grow impatient and seek help from other similar sites. To be able to retain visitors and drive traffic to your site you need to come up with ways of increasing your site speed.

What is lazy loading? Lazy is the situation whereby the site owner does not load resource on to his page until a user requires them. For instance you have a landing page-style homepage, which features numerous images and several videos as well. What happens with lazy loading the visitor will not view all the images once they load the page. Instead of loading these resources right away, the images will be loaded once the visitor scrolls down looking for them.

Setting your htaccess for Speed

There are several tweaks that can be made to your .htaccess file that can help with the speed of the site depending on how your server is configured

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]
RewriteRule ^(.*)$ — [F,L]
RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
RewriteCond %{QUERY_STRING} tag\= [NC,OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>|ê|”|;|\?|\*|=$).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(“|’|<|>|\|{||).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F|127\.0).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(request|select|insert|union|declare).* [NC]
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
RewriteRule ^(.*)$ — [F,L]
</IfModule>
#GZip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 2 days”
</IfModule>

Good hosting

The first step to increasing your site speed is to get decent web hosting. A good hosting foundation will set the stage. What you go with really depends on how serious the site is, and your budget.

Shared Hosting

Shared web hosting is when numerous websites share a single large server. This is the most economical web hosting option. Web hosting companies are able to provide the needed services at an affordable price. Id stay away from the really large hosts, they tend to cram them in.

Virtual Private Server (VPS)

VPS is partitioned so that it owns its’ own disc space, operating system and bandwidth. VPS hosting is done using a physical server that resides in a data center. To create private virtual server the server is divided into various spaces. You as the account holder you will only be able to see your own virtual environment and you can use your server as if it is your own dedicated server. This isn’t a bad idea, if you want something affordable but like control 🙂

Dedicated Hosting

Dedicated server is a perfect solution for high traffic websites and large businesses. It is everything you need to optimize and maximize the hosting experience for both you and your visitors. Dedicated hosting features a hosting control panel. This can come in two flavors either a physical box, or more recently cloud hosting.

Managed Hosting

This is when web host takes care of the server operation, hence you don’t have to. Managed hosting would be a perfect option if you have limited time or you lack IT knowledge. The downside is it costs more.

Comment below on and share you experiences on optimizing WordPress sites for speed. Ill be adding more to this as time goes on so make sure to bookmark it!