Online shoppers are impatient; an Aberdeen Group study from 2008 still holds true in saying that a web page must load in less than three seconds or it risks losing customers and revenue. So that means web pages are shrinking to meet this mandate, right? Not so, according to performance indices from HTTP Archive, which show that the average size of websites grew 32 percent in 2013. So if websites are getting bigger, and new research suggests that the magic number for load times might be inching closer to two seconds, what can companies do to shave precious milliseconds off page loading times? Here are some tips for cutting your load times:
- Consider implementing a content delivery network (CDN). A CDN takes a website’s static files – such as CSS, images and JavaScript – and delivers them on servers that are close to the user’s physical location. Because servers are closer to the user, they load more quickly. Larger websites implement CDNs to make sure their visitors from around the world have as fast an experience as possible.
- Implement new image formats to reduce the size of your images. According to the HTTP Archive, 61 percent of a website’s page weight on a desktop computer is images. Switching between different-sized and different-quality images to save bandwidth using tools like Picturefill and Adaptive Images can help. Adopting new image formats, such as WebP and JPeg XR, can also help reduce image weight by 20 to 50 percent without sacrificing quality.
- Cache, cache, cache. Browser caching stores cached versions of static resources, a process that quickens page speed tremendously and reduces server lag. When a user visits a page on your website, the cached version will usually be served unless it has changed since it was last cached; this saves a lot of requests to your server and as a result makes it faster.
- Evaluate your plugins. Plugins can bring new functionality and features to your website, but the more plugins your website has, the more work it has to do to load. Poor or outdated plugins can slow down website performance dramatically as well. This can be easily fixed by evaluating your current plugins and removing those that duplicate functionality, are out of date or are no longer used.
- Combine images into CSS sprites. If you have many images on your page, you are forcing multiple roundtrips of the server to get all the resources secured, which slows down page speed. Sprites combine all background images on a page into one single image. The proper image segment will be displayed because of the CSS background-image and background-position properties.
- Enable HTTP keep-alive response headers. HTTP requests are simple: they grab and send a single file and then close. That may be simple, but it isn’t very fast. Keep-alive allows the web browser and server to agree to use the same connection to grab and send multiple files. In other words, the server holds the connection open while a user is on the site instead of opening a new connection with every request, easing the load for the processor, network and memory.
- Enable compression. You can compress resources to lower the number of bytes a page is sending over a network. Using the GZIP compression algorithm, popular web servers like Apache and IIS do this automatically on HTML, CSS and Javascript. You will need to optimize your content for compression by creating consistency across your HTML and CSS code.
- Use expires headers. When a user visits your website, your website files will be stored on their computer so that your website loads faster for them the next time the visit; there’s an expiration date in the file header that determines how long these files will be stored on their computer, however. This expires header is usually set to 24 hours by default. You can configure the expires header so that the files never time out, or you can increase the expiration date significantly so that it doesn’t impact your server and page load time.
- Minify JavaScript and CSS. By removing unnecessary line breaks, extra space, and so on, you will speed up parsing, downloading and executing. This simple task can cut bytes of data from your page, and every little bit counts.
- Review your hosting provider and package. If you’ve taken the steps above and your pages are still loading too slowly, it might be time to consider a new hosting package. On a typical shared hosting account, you might be sharing server space with dozens of other companies, and the speed of your website is affected by the number of people using that server. If shared hosting no longer meets your needs, it might be time to consider dedicated hosting, where you alone have access to the server, or a VPS (Virtual Private Server), a physical computer partitioned into multiple servers each running its own operating system.
0 comments:
Post a Comment