Fast download time is an ongoing quest in web design and development. As noted on our web.html page (on the Analytics tabbed section)…”a number of factors affect web page load time, including but not limited to:
- number and “weight” of images/graphics (i.e. have the photos/images been optimized?);
- complexity/quantity of CSS stylesheets and scripts;
- references to external resources (such as Google Fonts, external javascript/jquery libraries, etc.);
- use of external resources (does your video play on your server or at YouTube?);
- the number of http requests required to load the page.”
The factors above are relevant to all websites; in addition, WordPress brings additional issues to the table, both with respect to the WordPress database itself, and the coding and behaviors of different plugins.
Fortunately there are WordPress plugins that can remediate WordPress-specific issues and simultaneously address many broader issues as well. (See Caching further down.) There are also various tweaks that can be made to the functions.php and wp-config.php files that remove unnecessary server requests, reduce the size of the database, etc.
Some issues, such as “weight” of images and photos have to be addressed at the source — there’s no getting around the need to optimize photos and graphics before loading them into a site, period.
Other issues, such as the number of of stylesheets, references to external resources, etc., represent the big grey areas requiring a series of independent judgements. For instance, I favor using a single stylesheet for all the themes styles, but I know folks who much prefer to separate key areas into separate stylesheets. They find it much easier to do updates. Each stylesheet requires another http request so one could argue that it’s better to combine them for that reason alone. But what about plugin stylesheets? I’ve read articles recommending that you deregister plugin stylesheets, copy their code and add them to the theme stylesheet and I haven’t been convinced to take that step. Why? Because plugins change and because I replace plugins if they don’t remain up-to-date. If I delete a plugin I don’t want to have to modify my main stylesheet as well. On the other hand, one of the things I look for in a plugin is whether it loads its stylesheets and javascripts only on pages that use the plugin, which reduces http requests for individual pages.
Caching
Caching involves keeping copies or “snapshots” of web pages on a server, in a browser, on a person’s device, etc., that can be called up when someone revisits a page eliminating the need for the page to be completely reassembled from the server. Different steps can be taken to create caching opportunities that can greatly speed up load time of individual web pages. Here again, though, options have to be weighed and a combination of techniques used so that the site reaps a speed benefit but doesn’t lose the ability to show updated content. Caching plugins include Hyper Cache, WP Total Cache and WP Super Cache. A plugin I particularly like is Quick Cache, but it hasn’t been updated for some time (sigh). My current preference is for Hyper Cache, which I have found to be simple to implement and use. Many people swear by WP Total Cache and Super Cache but I found both to be overwhelming. Worth a look, though!
We test our sites at Pingdom.com and GTMetrix.com (which includes tools from Google and Yahoo). They, in turn, check sites out from different servers in different parts of the world, so “scores” will vary from server to server. But they offer a good overall sense of how the site is doing, how quickly pages load, how many http requests are generated and areas where improvement is possible.