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.
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;
- Apache Server buffering;
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: //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.
- 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.
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:
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:
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:
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.