I’ve listed 30 ways to optimise your site for speed below: I’ll start with the obvious ones which many people nonetheless tend to forget these days, as they use fast connections themselves.
Media
1. Use smaller images – while images are not a problem for most Broadband users, they will still slow a site down significantly. You can resize and compress the same .JPG image so that it’s 50kb instead of 200 and still bring the point across. A very simple program like IrfanView can do it for you.
2. Use fewer images or gallery scripts instead – unless your site is about images, you don’t need to load several images at once. For more than a few images you can use gallery scripts.
3. Use fewer Flash animations or elements – you don’t use Flash as a web design element these days. Flash is used for webware, audio and video players, but most animations and Flash enhancements are obsolete by now.
4. Don’t use video – do you really need to load this video on your homepage? Consider video an additional asset that you show on demand on an extra page.
5. Don’t use audio – the worst thing to do on the Web is autoplay an audio file. I have a special tool that blocks unwanted music installed. In all other instances you can stream it on demand once the user clicks on it.
Files
6. Make fewer http requests – some simple websites send a hundred or more http requests; that means for each tiny image or script the site sends a request to the server. Consider whether you need each of the requests.
7. Merge image, style and script files – the most obvious way to limit http requests is to merge files. Having several CSS or Java Script files is, in many cases, not needed anyway. Use so-called CSS sprites to merge images.
Scripts
9. Use external scripts – don’t use inline scripts in actual HTML pages. Use external script files, or even better just one file.
10. Use short names for variables, functions and the like – a function like removeelementfromgroup() can be called refg() as well.
11. Use object oriented programming – OOP provides reusable script elements which you have to define once and can use all over your site instead of redefining them for each function etc.
12. Don’t use several redundant JavaScript libraries – while Java Script libraries provide great OOP elements you can reuse, I see more and more sites using several JS libraries at once, despite the fact that those libraries provide basically the same features.
13. Don’t use font replacement – font replacemnt tools for headlines look neat, but they are either built in Flash or in Java Script or both, and require considerable resources.
14. Cache your AJAX – apparently it’s quite easy to cache AJAX in order to save time on repetitive requests.
Web hosting
15. Switch to a faster server – SEOptimise switched to a faster server, or rather web hosting provider, a while ago. The old one was slowing down the site significantly.
16. Use a local server – take at a look at your analytics and find out where most of your users come from. Then host your site there instead of sending them to the other end of the world each time.
17. Use cloud hosting – shared hosting, or even dedicated servers, are fine most of the time but under a heavy load they become slow or can even time out. Cloud hosting, at least theoretically, does not, as your content is spread across many servers as is possible or needed in case of a large spike in traffic.
18. Use CDN – so-called Content Delivery Networks combine some of the advantages of local and cloud hosting. In a CDN, content is served from a server physically in the vicinity of the request.
Code
19. Load external scripts at the bottom – back in the day, you had to add Google Analytics to the head of an HTML page. So when GA was down, the whole page didn’t load. Make sure you load external scripts at the bottom of the page whenever possible.
20. Clean up your code – every site I check has some redundant code; sometimes even whole parts are not used, or they are enclosed in a comment. Clean up everything you don’t really need.
21. Don’t use tables – back in the day, people used tables to structure page content. With CSS and web standards this way of using HTML became obsolete, but many people (or rather programs) still do it to this day. Consider replacing tables with lists and layers (divs) to save lots of redundant code.
22. Compress your scripts (by removing white spaces in script files, for example) – even the most effective files still have lots of white space which enlarge them unnecessarily. While HTML and CSS may be a bit more difficult to compress, it’s easily done with scripts.
Databases
23. Don’t do URL rewrites – clean URLs are very important for SEO and usability, but it can increase the load time. Consider using clean URLs from the start instead of merely rewriting them. Also, Google can now index dynamic URLs that aren’t too complex. Something like shop?p=shoes&b=adidas&s=45 gets treated like shop/shoes/adidas/45.
24. Make fewer requests – again, you can save time by sending fewer database requests, especially for popular websites. For instance, you could use the same field for the html title tag, h1 and alt attribute of the header image. That’s one request instead of three.
25. Cache files as static data – instead of building each page for every user, each time you can save pages as static files – aka cache them. WordPress has a plugin for this WP Super Cache.
External services
26. Don’t activate Gravatar – sadly, Gravatar, which is used on WordPress by default, sends lots of requests. Even the default graphics are unique for every user who comments on your blog. You can save a lot by dumping Gravatar.
27. Don’t embed Facebook elements – while including Facebook tools on your page makes your content more shareable, you have to think twice before doing it. Do you have a significant audience on Facebook? Facebook tools loads dozens of elements to your site. Even Twitter buttons can slow down your site.
28. Use fewer web analytics tools or self-hosted ones – I have to admit I’m a web analytics junkie; I use Google Analytics, Piwik, Woopra, Reinvigorate on my sites at once. That’s a risk, of course; whenever one of them takes longer, your page does as well.
29. Use the faster Google Analytics embed code – there are at least two ways to include Google Analytics in your pages: the traditional one and the asynchronous one. The latter loads data in the background without halting your page load.
30. Don’t integrate third party widgets – widgets are all the rage now, especially third party ones. You can add all kinds of widgets to your site. Most of them are not really earning you money, while they increase load time.
Posted by Tad Chef
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.