How to Increase the Speed of Your WordPress Website by 300%

0
432

WordPress is now the most popular platform (CMS) for a single blog or website hosting.  This can be said with confidence, because many blog owners all over the world prefer to use the WordPress platform. A number of hosting providers already offer sites with WordPress pre-installed. They also provide a large number of publications discussing how best to capitalize on the new blog. WP is an effective and handy tool for the user; however, the lack of proper maintenance can significantly slow down your blog or website. Previously, in my article “How to Improve Website Speed & Website Performance“, I wrote about steps you can take to improve the loading of your site. In this article today, I will be focusing more on steps I took to speed-up the WordPress website. I am going to highlight one of the major issues facing the administrators of the WordPress blogs and websites: how to make the site load faster.

Fast page load times is one of the most important aspects of any blog or website. If your site is running slowly, you risk getting a poor position on search engines, and visitors who have come to you for the first time will not return to your site again. Nobody likes to look through slow-loading websites. If your website is slow, then you can easily lose a lot of visitors. But do not worry ahead of time. There are simple things that can help you make your website faster.

So to start with, lets look at the website performance now and then compare it with the performance after optimization. Here are my screenshots of www.vitalwebmaster.com prior to and after the optimization.

pingdom-April1-2014-test

performance4-1-2015 9-05-50 AM

webpagetest-vitalyonline-test-5-6-2013

For testing, you can use a variety of tools such as a convenient plug-in for Mozilla Firefox called YSlow, or free online tools such as Gtmetrix. I wrote about other website speed testing tools that are available online. I really like Gtmetrix and Webpagetest.

The first page loading speed will depend on the host where the blog is hosted. However, you can overload your site with installing so many useless plugins that your site could load slowly even when hosted on the best hosting site. Believe it or not, web hosting is one of the most important components affecting the performance of your blog. Without going into details, here is a very simple description of the most popular types of hosting services that will help you to estimate the load on the server:

  • Shared Hosting– On average, about 100 people can be hosted on a single server.
  • VPS– about 20 people can be hosted on a single server;
  • Dedicated – server will be used only by you.

To view the estimated load on the server, sign in via ssh and type the following command into the console top . This does not mean that you cannot speed up the blog running on a virtual server (Shared Hosting). the geographical location of the server is also very important. You should always remember your target audience. For example, if your audience is in Ukraine, you should not host your site on an American hosting server, etc.

It is important to understand different methods that you can use to perform caching and optimization of your website.

Caching is when you save final data of the results of the script (program, site engine, CMS) in a temporary storage, in order to further replace or reduce the script. When necessary, data or the results of the script are retrieved from storage (cache), without wasting time on the processing of information (e.g. of the script). Basically, the documents stored in the cache will be available the next time it is accessed. Caching speeds up the process of displaying information to the user.

There are many options for caching, which differ in the method of caching and type of cache. Below is a list of the main Web caching options:

  • The query cache (DBMS);
  • File cache;
  • Caching by a tree (tree cache);
  • Delivering static pages;
  • Web caching, HTTP;
  • Associative memory, associative array;
  • Hashing;
  • Buffering;
  • Gateway;
  • Proxy;
  • Apache Server buffering;
  • etc.

I would highly recommend reading this “Caching Tutorial” also W3.org provides additional information on caching protocols, see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

For dynamic pages that are created as a result of the PHP-program (such as CMS: WordPress, Joomla, Drupal), caching can be harmful if not implemented properly. However, caching can be very helpful and even recommended. By controlling your cache, you can make your server work for your visitors, allowing the load of cached pages to the client’s browser and preventing their re-upload to your server. Through caching you will save time and bandwidth.

Cache or not?

The need for the use of the cache is determined by you, based on your needs and website functionality.

For example, if a use has to search a word on a page, then this page is required to be queried without using the cache, since the number of variants of the requested words is huge. However, if we are talking about the same graph on your website, but it was published yesterday, the cache is recommended. Here you can predict the end date “shelf life” generated data.

Here are Some helpful tips to speed up WordPress site:

Those tips are general and really helped me to maximize my site’s performance.

Choose a good and reliable hosting

When choosing a web hosting do not look primarily at its cost, pay attention to its reliability and age. In fact, hosting plays a crucial role in ensuring the a good performance of your website. Never try to work with free hosting companies, because in the future you may experience difficulties. Even your site can blocked without any explanation (free resource=no accountability).

Use a good and simple theme

When you create a website on WordPress, you should make sure that it will be one of the best among its competitors. And the choice of the theme plays an important role as well as the hosting. The theme should have a clean code without any hidden links to other sites. Do not be afraid to spend some money on a really good theme that comes with free updates. If the basic features of the site run smoothly, the effect will certainly be displayed in high performance. If you have an unlimited budget, it is best to order a custom template from freelancers.

Use the page caching plugin

Caching can improve the load time of your site at times. A plug-in this case loads the pages of your site to the visitor’s browser, they are loaded only once, instead of having to load at each time you access the site.

For my purposes I used the following plugins (some are free and some not):

  • I purchased ZenCache (used to be called QuickCache Pro). This plugin gives an excellent performance and reduces the load of the blog. The plugin is easy to install and to configure, there is not a lot of functions and settings as in the ‘W3 Total Cache‘  plugin, but basically enough for the average blog with attendance of 2 – 3 thousand people a day. You may want to consider other plugins that are free of charge, such as ‘W3 Total Cache’ or ‘WP Super Cache’, etc. You can read a little more about each plugin here: https://www.wptouch.com/support/knowledgebase/optimizing-caching-plugins-for-mobile-use/
  • I also use Free ‘Advanced Lazy Load‘ plugin that loads images based on user screen scrolling. It certainly reduces the loading time of your WordPress website, especially if your website has a lot of posts with images. I noticed that this plugin works well with ZenCache plugin and does not introduce any incompatibilities.
  • CloudFlare plugin helps mostly to protect your website from being hacked. CloudFlare offers free CDN hosting that you may want to consider for your static resources. I used Amazon Cloud hosting services to host all static scripts, images, and documents.
  • Since ZenCache does not offer an absolute solution for your website optimization, I used ‘JS & CSS Script Optimizer‘ to combine all scripts into the single file (it also minifies CSS and JavaScript files). The default configuration may not produce the optimal results. That’s why I configured it until I was certain that it will not break or cause any issues to my website. It is important, that after enabling each plugin you keep an eye on the overall performance of the website.

js-css-script-optimizer

  • If you have custom CSS on your website, do not use your theme or WordPress Jetpack plugin to add custom CSS on your pages. You will encounter loading problems and will not achieve the desirable performance results. Because certain aspects of my website require custom CSS, I use ‘Adding CSS‘ plugin. It is very light, easy to use and does not conflict with other resources on your website.
  • “Remove query strings from static resources like CSS & JS files. This plugin will improve your scores in services like PageSpeed, YSlow, Pingdoom and GTmetrix.” It is important for your site’s performance. Just as the developers of the plugin stated above, ‘Remove query strings from static resources‘ plugin is doing just as that, it removes query strings from your static resources without you going through your files and doing it manually.
  • I use “Slim Jetpack” plugin with Jetpack plugin, in order to reduce the loading of the original Jetpack. You can read more about WordPress Jetpack here: https://wordpress.org/plugins/jetpack/developers/
  • I also noticed that HTML is not compressed after I activated ZenCache and configured so it would compress HTML. Since it was not doing its job properly, I added ‘WP-HTML-Compression‘ plugin.
  • Another very useful plugin to consider is ‘WP CDN Rewrite‘. Although ZenCache does an excellent job with rewriting static resources to point to CDN hosting, WP CDN Rewrite, picks up where ZenCache has missed. It is important that all static sources are hosted on CDN network.
  • WP Smush.it‘ plugin reduces image file sizes and improves performance of your WordPress website. Instead of optimizing each image manually, they are optimized for you on fly. I will quickly speak about the image optimization below.

Image Optimization

Images are an important part of the content. Personally I have not seen a site that would not have a image. However, if the site has a large amount of images and photos, it will lead to a significant load on the site, slowing the site’s performance. You can optimize all the images without losing image quality. If you do it manually and optimize each image it will be time-consuming. Instead of doing this manually, you can use a plugin called ‘WP Smush.it’. This plugin will automatically optimize all images on your site and those that you are uploading during your article publishing.

Reduce the use of plug-ins

I know, I’ve given you some tips on improving the WordPress website performance through the plugin (a lot of them!) and now I will be preaching about that you should not use a lot of plugins on your website. Plugins are needed on your WordPress website to improve its functionality. But remember, do not abuse them, because a lot of them can also slow down your site. Choose only those plugins that you think are necessary and will improve the performance of your blog or website.

Leverage browser caching

Ok, I have been struggling with this one for a long time. I did not know how to leverage browser caching. After long hours of research and work, I’ve figured out how it is done!
If you want to host static files on CDN hosting (such as Amazon Cloud or Cloudflare), then consider adding the following lines to your .htaccess file in the wp-content directory:

.htaccess Code for wp-content

<IfModule filter_module>

AddOutputFilterByType DEFLATE text/plain text/html

AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd

AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml

AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript

AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf

AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf

</IfModule>

</IfModule>

<IfModule mod_headers.c>

Header unset Pragma

FileETag None

Header unset ETag

Header always set Strict-Transport-Security “max-age=16070400; includeSubDomains”

</IfModule>

<filesMatch “.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff|woff)$”>

Header set Expires “access plus 1 year”

Header set Last-Modified “Mon, 15 Sep 2014 20:00:00 GMT”

</filesMatch>

<FilesMatch “.(js|css|jpg|png|jpeg|gif|xml|json|txt|pdf|mov|avi|otf|woff|ico|swf)$”>

RequestHeader unset Cookie

Header unset Cookie

Header unset Set-Cookie

Also, remember that your main root directly .htaccess file  should also include gzip commands and other methods that would help with the performance of the website. Here is an excerpt of a sample htaccess file that I’ve created:

.htaccess Code for root directory
<IfModule deflate_module>
<IfModule filter_module>
AddOutputFilterByType DEFLATE text/plain text/html
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf
AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf
</IfModule>
</IfModule>

Header unset Pragma
FileETag None
Header unset ETag
<IfModule mod_headers.c>
Header always set Strict-Transport-Security “max-age=16070400; includeSubDomains”
</IfModule>
<filesMatch “.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff|woff)$”>
Header set Expires “access plus 1 year”
Header set Last-Modified “Mon, 15 Sep 2014 20:00:00 GMT”
</filesMatch>
#### BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType application/x-javascript .js
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
AddType video/asf .asf .asx .wax .wmv .wmx
AddType video/avi .avi
AddType image/bmp .bmp
AddType application/java .class
AddType video/divx .divx
AddType application/msword .doc .docx
AddType application/x-msdownload .exe
AddType image/gif .gif
AddType application/x-gzip .gz .gzip
AddType image/x-icon .ico
AddType image/jpeg .jpg .jpeg .jpe
AddType application/vnd.ms-access .mdb
AddType audio/midi .mid .midi
AddType video/quicktime .mov .qt
AddType audio/mpeg .mp3 .m4a
AddType video/mp4 .mp4 .m4v
AddType video/mpeg .mpeg .mpg .mpe
AddType application/vnd.ms-project .mpp
AddType application/vnd.oasis.opendocument.database .odb
AddType application/vnd.oasis.opendocument.chart .odc
AddType application/vnd.oasis.opendocument.formula .odf
AddType application/vnd.oasis.opendocument.graphics .odg
AddType application/vnd.oasis.opendocument.presentation .odp
AddType application/vnd.oasis.opendocument.spreadsheet .ods
AddType application/vnd.oasis.opendocument.text .odt
AddType audio/ogg .ogg
AddType application/pdf .pdf
AddType image/png .png
AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
AddType audio/x-realaudio .ra .ram
AddType application/x-shockwave-flash .swf
AddType application/x-tar .tar
AddType image/tiff .tif .tiff
AddType audio/wav .wav
AddType audio/wma .wma
AddType application/vnd.ms-write .wri
AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
AddType application/zip .zip
AddType application/vnd.bw-fontobject .eot
AddType application/x-font-ttf .ttf
</IfModule>
#### BEGIN EXPIRES CACHING
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A29030400
ExpiresByType text/css A31536000
ExpiresByType application/x-javascript A31536000
ExpiresByType text/richtext A604800
ExpiresByType image/svg+xml A604800
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType text/php A31536000
ExpiresByType video/asf A31536000
ExpiresByType video/avi A31536000
ExpiresByType image/bmp A31536000
ExpiresByType application/java A31536000
ExpiresByType video/divx A31536000
ExpiresByType application/msword A31536000
ExpiresByType application/x-msdownload A31536000
ExpiresByType image/gif A31536000
ExpiresByType application/x-gzip A31536000
ExpiresByType image/x-icon A31536000
ExpiresByType image/icon A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType application/vnd.ms-access A31536000
ExpiresByType audio/midi A31536000
ExpiresByType video/quicktime A31536000
ExpiresByType audio/mpeg A31536000
ExpiresByType video/mp4 A31536000
ExpiresByType video/mpeg A31536000
ExpiresByType application/vnd.ms-project A31536000
ExpiresByType application/vnd.oasis.opendocument.database A31536000
ExpiresByType application/vnd.oasis.opendocument.chart A31536000
ExpiresByType application/vnd.oasis.opendocument.formula A31536000
ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
ExpiresByType application/vnd.oasis.opendocument.text A31536000
ExpiresByType audio/ogg A31536000
ExpiresByType application/pdf A31536000
ExpiresByType image/png A31536000
ExpiresByType application/vnd.ms-powerpoint A31536000
ExpiresByType audio/x-realaudio A31536000
ExpiresByType application/x-shockwave-flash A31536000
ExpiresByType application/x-tar A31536000
ExpiresByType image/tiff A31536000
ExpiresByType audio/wav A31536000
ExpiresByType audio/wma A31536000
ExpiresByType application/vnd.ms-write A31536000
ExpiresByType application/vnd.ms-excel A31536000
ExpiresByType application/zip A31536000
ExpiresByType font/ttf A31536000
ExpiresByType image/svg+xml A31536000
ExpiresByType font/ttf “access plus 1 year”
ExpiresByType application/vnd.ms-fontobject “access plus 1 year”
</IfModule>
#### Compression with gzip
<IfModule mod_gzip.c>
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
AddEncoding gzip .gzip
mod_gzip_on YES
mod_gzip_handle_methods GET
mod_gzip_temp_dir /tmp
mod_gzip_can_negotiate Yes
mod_gzip_dechunk Yes
mod_gzip_send_vary On
mod_gzip_update_static No
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size 250
mod_gzip_maximum_file_size 1048576
mod_gzip_maximum_inmem_size 60000
mod_gzip_min_http 1000
mod_gzip_item_exclude reqheader “User-agent: Mozilla/4.0[678]“
mod_gzip_item_include mime ^application/pdf$
mod_gzip_item_include mime ^image/
mod_gzip_item_include mime ^application/x-javascript$
mod_gzip_item_include file .js$
mod_gzip_item_include file .woff$
mod_gzip_item_include file .css$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include file .html$
mod_gzip_item_include file .php$
mod_gzip_item_include file .pl$
mod_gzip_item_include file .cgi$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_item_include mime ^application/postscript$
</IfModule>
### Deflate files to fasten the loading ####
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript text/x-js text/ecmascript application/ecmascript text/vbscript text/fluffscript
AddOutputFilterByType DEFLATE image/svg+xml application/x-font-ttf application/x-font font/opentype font/otf font/ttf application/x-font-true type application/x-font-opentype application/vnd.ms-fontobject application/vnd.oasis.opendocument.formula-template
AddOutputFilterByType DEFLATE text/xml application/xml
</IfModule>
</IfModule>
<FilesMatch “.(css|js|CSS|JS)$”>
<IfModule mod_headers.c>
Header set Pragma “public”
Header append Cache-Control “public, must-revalidate, proxy-revalidate”
</IfModule>
</FilesMatch>
<FilesMatch “.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|x?html?|php|)$”>
<IfModule mod_headers.c>
Header set Pragma “public”
Header append Cache-Control “public, must-revalidate, proxy-revalidate”
</IfModule>
</FilesMatch>
<FilesMatch “.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3
|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri
|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT
|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA
|WRI|XLA|XLS|XLSX|XLT|XLW|ZIP)$”>
<IfModule mod_headers.c>
Header set Pragma “public”
Header append Cache-Control “public, must-revalidate, proxy-revalidate”
</IfModule>
</FilesMatch>

Conclusion

In general, even the most ordinary blog can be accelerated. I have started with a very poor performance of my website and have been able to succeed in making the site load much faster. Here are some screenshots of my success:

performance4-1-2015 9-05-50 AM

vitalwebmaster-test-gtmetrix

vitalwebmaster-test-webpagetest

Most likely in the near future we will have separate assemblies of WordPress, configured for maximum performance when using any theme. Now you can simply use the above tips and strive to increase the performance of your website, which will lead in an increase in the number of visitors and regular readers to your blog or website.

There are a lot of other tips that are tailored to your specific website that would increase the performance of your site. I would like to share them with you. Please call (801) 214-8104 to schedule your free consultation to see how I can help to increase your performance and visibility. Or, you can simply Contact Me by submitting your inquiry online.