Speed is vital for modern websites, particularly those which deals with e-commerce, every ms (millisecond) counts, and it all adds up and is a big turn off for prospective customers.
Recently I optimised the site of my UK Web Hosting business XDnet.co.uk before I started work the site was, well abysmal when it comes to speed. The Pingdom putting it at 14-16 seconds, slower than 90%+ of sites according to Pingdom, before the page fully loaded with some basic optimisation techniques and a little bit of work I’ve gotten this down to 1.67 seconds.
1. Minify it!
Compressing your code down is one of the simplest ways to gain a few precious milliseconds and it’s dead easy as there are plenty of tools you can use to compress your CSS and Javscript files.
www.minifycss.com/css-compressor/ is a fantastic tool with loads of useful settings to help manage the way it compresses the CSS to ensure efficiency and even improves your CSS code!
Note: With both JS and CSS compression you should ALWAYS ensure you keep a uncompressed copy for future changes. It’s a good idea to simply save the compressed versions as <filename>.min.css as this will help you easily identify the versions in future.
2. Combine, Merge, Reduce!
3. Content Delivery Network (CDN) static content
CDNs can be useful, but should be used with care, they aren’t a magic solution and can in-fact slow down your site if you don’t use a good CDN service.
Personally I snapped up a free TB of data with MaxCDN during their speedawareness month and have been testing that out, the results in speed improvements do vary depending on your location as in some cases it is a few ms faster when delivered directly from the server, but overall on a global scale it does improve the average speed.
Ideally you want to be serving all static CSS, JS and Images over CDN for the best results. This can also help with other slow-down factors such as paralleled downloads across hostnames.
4. Parallelize Downloads across hostnames/domains
As specified in HTTP 1.1 browsers have a limit on the number of concurrent connections they make to hostnames, this generally seems to vary between 2 and 20.
This often means if you have a lot of files on the same hostname/domain e.g. mysite.com/images/ then the browser will connect to the first X items to download, and the rest have to wait for the first batch to finish before they can start. By spreading the files across multiple hostnames, such as cdn.mysite.com/images/file.png and cdn2.mysite.com/images/otherfile.png – this can help speed things up by allowing for more objects to download in parallel. This method does have limitations, and should be tested as the DNS lookup time can counteract the benefits so it’s worth checking.
A big time suck for my site was a few poor coding choices which caused unnecessary wait time while PHP did it’s thing to generate the page. The killer was lookup requests grabbing the latest tweet & blog posts to display.
There are also numerous other ways to optimise your code but it’s important to give everything an eye over it’s often surprising just how much basic code improvements can improve your site speed.
Hope these tips have helped, if they have or if you have any more tips please leave a comment below, or tweet me @dansgalaxy
Last year a previously theoretical attack surfaced which can allow TLS security to be manipulated and weakened, it’s a simple attack and one which a simple configuration change can patch. Learn more about the BEAST attack on TLS here.
To patch Apache in cPanel is a simple 2 step process.
Login to WHM and navigate to: Service Configuration -> Apache Configuration -> Global Configuration
Here select the custom option for “SSL Cipher Suite” and enter the following:
Click Save, then click, Rebuild Configuration and Restart Apache to compile the config change.
In WHM navigate to: Service Configuration -> Apache Configuration -> Include Editor
Select “All Versions” under the “Pre VirtualHost Include” section.
In the text box enter the following:
Click Update, then Restart Apache.
Your cPanel server should now be patched against the BEAST TLS attack, you can verify this using a security checking tool such as SSLLabs.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.