20 Quick Tips to Optimize Page Load TimePosted on Monday, 14 January 2013 by Boris Demaria
Web page loading speed is the most crucial part of a site’s usability and SEO. Google considers page speed to be one of the 200 ranking factors that influence a website’s position in organic search results and is known to enrich user-experience. With numerous other websites in your niche the competition to earn site traffic and keep people impressed with rich usability is becoming more crucial every day. If your website does not load quickly chances are you will lose site visitors to your competition in a matter of seconds.
Here are 20 quick tips aimed at optimizing your website’s loading time:
1. Optimize Image Size:
The images on your site take up a lot of your page size and can eventually affect the loading time of your page. It is not enough to downsize your website’s images in the HTML editor because that only changes the appearance of the image in the front-end and not its actual size. Use external picture editor tools to resize the images, such as Photoshop.
Here are some online tools to optimize your site’s images:
2. Image File Format:
For optimized loading time of your page it is ideal to stick to standard image formats such as JPG, PNG and GIF.
3. Avoid Text Graphics:
Some sites may need stylized text to make the web page look attractive. However, you must remember that text in the form of an image can take up a lot of the web page size and is of no use for SEO. It is thus ideal to use the text styles in CSS and keep everything in text format instead.
4. Avoid Unnecessary Plugins:
A site that requires plugins may slow your page loading speed. Not all plugins are unnecessary, for example, social share plugins which are a must-have for every site these days. That said, always check to see if there is a better alternative to the plugin, for example, using a CMS with in-built social plugins.
5. Avoid Inline JS and CSS files:
It is a good practice to place your website’s JS and CSS in external files. When the page loads the browser caches these files externally and reduces the page load time. Moreover, having the JS and CSS files externally allows for easy site maintenance.
6. Optimize Caching:
Every time a visitor loads a site, your web page’s image files, CSS and Java files load as well, thus taking up a lot of page load time. When you use the HTTP caching system on your website it allows these file resources to be cached or saved by the browser or proxy. On repeated page loads these files can be retrieved from the cached files rather than downloading them all over again from the network. Moreover, by optimizing the caching system of your website you also tend to reduce the bandwidth and hosting costs on your site.
Ensure that your JS file is placed at the end of documents as JS file load may hinder the loading of the subsequent files.
8. Avoid Redirects:
Avoiding redirects increases serving speed. Some redirects are unavoidable and need to be in place but you must remember that this requires an additional HTTP which increases the page load time. Check for broken links and fix them immediately.
9. Reduce DNS Lookups:
DNS (Domain Name System) Lookup occurs when a URL (hostname) is typed in a browser and a DNS resolver returns that server’s IP address. The time needed for this process is around 20 – 120 milliseconds, however, multiple hostnames can be used for various elements on a website, which includes the URL, images, script files, style sheets and flash elements. With multiple unique hostnames the DNS lookup also increases thus increasing the page load time. Reducing the number of unique hostnames will reduce the number of parallel downloads, which may increase the page loading time. It is thus ideal to use one host when you have less than six resources. You can also use URL paths instead of hostnames. This means that if you have a blog page that is hosted on blog.yoursite.com, you can instead host it on www.yoursite.com/blog.
10. Remove Unnecessary CSS and HTML:
Lighten the code of your website by removing any HTML or CSS that is not required. If your site is built on a CMS, chances are you have pre-installed CSS class and id ‘stubs’ that help design the theme. Remove unused class and ID declarations or combine multiple declarations into one.
11. Avoid Multiple Tracking Scripts:
While it is wise to keep tabs on your website’s traffic stats, it is not advisable to use multiple tracking softwares as this may hinder the page load time. If you are using a CMS such as WordPress, you could allow WP stats to run scripts on your page or Google Analytics, but never both. E-commerce shopping cart CMS tend to have their own default tracking script which cannot be deleted when you use Google Analytics instead.
12. Set up G-Zip Encoding:
Similar to files on your PC that are zipped and compressed to reduce the total size during online file transfers, heavy files on your website can be zipped with something called the G-Zip Compression. This saves bandwidth and download time and most of all reduces your page loading speed. You should configure the server so that it returns zipped content.
13. Reduce HTTP Requests:
Use CSS Sprites to reduce the number of image requests. Combine background images into a single image by using CSS background-image and background-position elements. Combine inline images into your cached stylesheets. HTTP requests are multiplied when there are duplicate scripts in the code so ensure that you identify and remove these duplicate scripts. To keep duplication under control use Script tag on your HTML page, as shown in the example below:
You may use an insertScript function in your PHP page, as shown in this example:
<?php insertScript(“menu.js”) ?>
14. Use Expires/Cache-Control Header:
You can use Expires headers for static components of the site and Cache-Control headers for dynamic ones. Using these headers makes the various components of a site, including images, stylesheets, scripts and flash, cacheable. This in turn minimizes HTTP requests and thus improves the page load time. With the use of Expires headers you can actually control the length of time that components of a web page can be cached, as shown in the example below:
Expires: Wed, 20 Apr 2015 20:00:00 GMT
If your server is Apache you can set the time for cached content by using the ExpiresDefault directive. This sets the expiration date as a certain number of years from the current date:
ExpiresDefault “access plus 15 years”
15. Place Style Sheets at the top of Documents:
It is standard practice to place style sheets at the top of a document. The page elements that are rendered from the server open progressively in your browser as initiated by these style elements. From the navigation bar and logo to the page content, the visual progression of a loading website gives rich user experience, even if a user has a slow internet connection. Style sheets also improve the page load time.
Minification is the process of removing unused characters from the code which helps to reduce its size and the subsequent loading time.
The following are two such minification tools available online:
17. Use GET Requests instead of POST:
It is found that using the html ‘METHOD’ attribute GET processes data much faster than POST when requesting data on a browser. Although both HTTP methods achieve the same result, POST sends the header first and then sends the data while GET takes only one TCP packet to send data. Also, GET is recommended for AJAX requests as it can be cached and remains in the browser history.
18. Avoid unnecessary DOM elements:
19. Reduce Cookie Size:
The data stored in cookies is exchanged between servers and browsers. Hence, by reducing the size of the cookies you reduce the size of the data that is transferred and increase the page load time. Eliminate unnecessary cookies and set your Expires date to a sooner time period, or provide no Expires date at all to reduce the size of the cookies.
20. Update CMS Software
If you are using a CMS such as WordPress it is recommended to check frequently for updates in the software but do not load these on a live website. First carry out upgrades on a separate server to test them. Keeping abreast of software updates also improves a site’s speed.
You can test your website’s page load time and page size with the WooRank Website Review tool. A sample test is shown in the screenshot below:
You can check for speed factors that are present or absent in your site with the same test:
For more tutorials on page speed optimization check out a list of related Google Articles.