The study shows that the "Web page slow to load" is the top frustration, and that 6 out of 10 tablet users want a sub-three second download. Keep in mind that the top activities for tablets are to read news and entertainment, search for information and watch videos. Having a fast website means getting rid of all that's not the focus of your experience. If you can do without it, do without it.
The three basic tips on reducing the loading time would be:
- Reduce the dependencies
- Reduce the image dimensions
- Reduce the client-side processing
Reduce the dependencies
The less the downloads, the less the HTTP requests. Try these tips for size:
- Load images as background images in CSS and use media quarites to conditionally hide tham.
- Combine style sheets into a single file and reduce the number of HTTP requests, or use inline styles, which results in a single additional HTTP request to download all page styles.
- Use CSS3, such as rounded corners, drop shadows, gradient fills, and so on — these styling features can be used instead of images, reducing the number of HTTP requests and speeding up loading time.
- Use image sprites. The basic idea is to combine commonly used images into a single image, reducing the number of HTTP requests. The required image is then beind displayed by using the CSS.
One of Amazon mobile sprites. Image source
- Use font icons instead of images; by combining multiple icons into a single Web font, the number of HTTP requests for all icons can be reduced to one. Also, font icons can be animated using CSS3 keyframe animation, which is handy for "loading" icons, the only downside of CSS sprites is that they can only be in one solid color.
- Avoid inline frames. Each iframe results in a HTTP request, in addition to any of it's dependencies. Having a single iframe adds 0.2 seconds to the loading time. If you want a fast website, iframes are not the way to go.
- Code for mobile-first. Start by coding for mobile users first and then move up to tablets and desktops. Reduce any unnecessary dependencies. Compare it the desktp coding first.
- Separate mobile websites. Keep your key content on the page, while linking the secondary content, reducing the HTML requests and preventing any associated dependencies from being downloaded. Amazon's content split method saved them 45 KB size of HTML. Keep your redirects to a minimum. Amazon's single redirect results a 0.4 second delay. Dell's website has two redirects, which result in a 1.2 second delay.
Reduce the image dimensions
Simply use responsive images.
The main benefits of these responsive-image techniques are:
- small screens download low-resolution images, while large screens download high-resolution images
- only the required images are downloaded, while unneeded images aren't loaded in the background, reducing the "load" time of your site
Reduce the client-side processing
Avoid widgets. What is a "Web Widget"? A web widget is a small helpful software program embedded directly into a web page, it just occupies a portion of a webpage and does something useful with information fetched from other websites and displayed in place. Widgets can have a horrible impact on real loading time, causing an average 0.9 second delay.
Don't forget to test your website on multiple devices. A fast load time on any given android or mobile device is the ultimate green light for your website load time efficiency.
Read detailed how-to with examples on SmashingMagazine.
- Optimizing Page Speed - Actionable Tips For SEOs and Web Developers
- How to Improve Your Conversion Rates with a Faster Website
- Load Time: Be Kind to Your Users
- CSS vs. JS Animation: Which is Faster?