development – digital arts – internet
Knowledge is free. No one may take possession of it.
29. March 2015
Without any doubt it is important for every website to be as fast as possible in order to save bandwith, visitors time and in terms of SEO. As I recently had to optimize various WordPress websites regarding their page speed delivery here is what I did.
Getting to know your current website performanceFirst of all you have to find out how well your website was built and how well speed optimization has been performed. Therefore there are various tool you may use:
- Google PageSpeed Insights (https://developers.google.com/speed/pagespeed/)
- Pingdom Website Speed Test (http://tools.pingdom.com/fpt/)
- YSlow Browser Plugin (http://yslow.org/)
- and many more....
Common performance problems and how to solve themIn the documentation of these tools you will find detailed description on how to improve your website speed including ...
- optimize your images / media
- reduce server response time
- reduce the number of http requests
- avoid / reduce blocking resources (js/css)
- prioritizing visible contents
WordPress Page Speed Optimization: Hands onThe great thing about WordPress is that there are like 10 Plugins for every possible thing you can imagine. An important task for WordPress developers is to find and configure the appropriate ones while still knowing which things to do manually. With the following combination of Plugins and Configurations I have created really nice results in LAMP environments:
Reducing ImagesEWWW Image Optimizer , Timthumb (resizing & quality of 70)
MinificationSASS or LESS with -x compress option, Autopimize WordPress Plugin. Note: Most probably you will have to organize your scripts and styles in some appropriate manner in order to use the full power of this Plugins. Of course you also have the possibility to minify all your files manually.
Avoid / reduce blocking ressourcesThis is a task is one of the most complex and you probably have to do it manually. Write clean CSS and keep it small. Do not use too much external scripts and combine these into as few as possible.
Reduce Server response time: CachingMy favorite Plugin for WordPress is ZenCache and if you do not have too much dynamic contents it is probably recommendable to allow client-side cache within the options. However there are some probably nice alternatives like W3 total cache. Furthermore you can use your .htaccess on Apache (see below).
CompressionApache has a module which is called mod_deflate. An example of a WordPress .htaccess file which has been built for website speed optimization is shown below - go adjust it to your needs: