- 1 Components are gzipped
- 2 CSS is linked first in <head>
- 3 Site has no broken links
- 5 Inline scripting and styling is made external
- 6 Expires headers are used advantageously
- 7 Start Render time is under two seconds
- 8 Character set declared
- 9 Specific HTML5 input types are used
- 10 Images are used as sparingly as possible
- 12 Shim included for new HTML5 elements
- 13 HTML is properly semantic
- 14 A label element is associated with each form input
- 15 CSS @import is avoided
- 16 CSS files are concatenated and served singly
- 17 Flash content has HTML5 fallback
- 18 Single pages are smaller than 500K
- 19 Images are correctly sized
- 20 Google Library APIs are used when possible
- 21 All images have height and width set
- 22 Element-level styles are minimized
- 23 Analytics software is monitoring site
- 24 PNGs are used instead of GIFs
- 25 Site is HTML5, the evolving standard
- 26 Content prints well or a print style sheet is included
- 27 CSS reset is used
- 29 Ajax is cached
- 30 ETags are configured
- 31 CSS expressions are not used
- 32 Site has no duplicated code
- 33 Pages do not have avoidable redirects
- 34 All elements have correct cursor on hover
- 35 IDs are unique to a page
- 37 CSS files are minified
- 38 Custom fonts are lightweight and justified
- 39 No class attribute values resemble HTML element names
- 40 All images have alt tag values
- 41 !important is avoided
- 42 No site text is delivered as images
- 43 document.write() is avoided
- 44 Legacy XHTML close tags are removed
Components are gzipped
Gzipping components is now pervasive, but it’s such an easy, big win that you should confirm your web server is sending compressed files. For scripts and CSS the savings are huge; less so for images, which should already be optimized.
This should be done to reduce HTTP requests. Also, if scripts are included in concatenating them is key, because multiple scripts have a blocking behavior.
Inline scripting and styling is made external
Expires headers are used advantageously
If a component is rarely updated, leverage browser caching.
Start Render time is under two seconds
You don’t want users staring at a white screen. Confirm that Start Render time is within 2.01 seconds. (Please remind me to justify this number I am now offering as a rule of thumb with no explanation.) WebPageTest.org can tell you Start Render time as well as a lot of other useful information. Waterfall charts — which WebPageTest.org will generate for you — indicate Start Render time as a first vertical line, usually blue.
If Start Render time is greater than two seconds, you will need to optimize.
Character set declared
The HTML5 character set is very elegant: . Failing to include a character set is a security risk. While this is important, it is uncommon to forget it.
Content, Security, Uncommon, Validation
Specific HTML5 input types are used
This is especially important for mobile devices that show customized keypads and widgets for different types.
HTML5, Mobile, Validation
Images are used as sparingly as possible
Images are HTTP requests that slow down rendering and should be minimized. Unless your HTML document is something as primitive as an HTML email, images should not be used for layout. Replace corners, single pixel spacer gifs, shadows, gradients…etc. with CSS3. Very complicated and detailed patterns can be created with CSS.
If the images cannot be replaced with CSS — that is, if it absolutely must be a graphic — collect images into image sprites or consider using using a font face as a library of icons.
Content, CSS, Performance
Shim included for new HTML5 elements
New HTML5 elements are not recognized by Internet Explorer versions less than 9. These browsers still have a huge market share, and it is highly recommended that you use an HTML5 shim.
HTML is properly semantic
This is an important and loaded checklist item. If the site is HTML5 (first line is <!DOCTYPE html>), tags like <header>, <footer> and <nav> should be used. Menu items should be marked up as an ordered list.
Common things that should be avoided are using the <br> tag for formatting, using <b> when you mean <strong>, or worse, using <b> when the content is a heading.
A label element is associated with each form input
Guidance from 456 Berea Street, Use the label element to make your HTML forms accessible:
All visible form controls except buttons should have an associated label element (buttons are self-labelling). The label element can be associated with its form control either implicitly or explicitly. An implicit association is created by putting the form control inside the label element, while an explicit association is created by giving the label element a for attribute with the same value as the form control’s id attribute.
CSS @import is avoided
Include external css files with <link> instead of @import, directly after the open <head> tag: <head><link href=’/css/styles.css’ rel=’stylesheet’ />...
CSS files are concatenated and served singly
This should be done to reduce HTTP requests.
Flash content has HTML5 fallback
iOS does not support Flash. If you want your site to work on mobile devices, replace Flash with HTML5 or at least include an HTML5 fallback to support that ever-growing group of users.
Content, HTML5, Mobile, SEO
Single pages are smaller than 500K
It’s true that the average web site’s size has surpassed 1MB. But it is also true that most web sites are excruciatingly slow and unusable on mobile — mobile being the future of web browsing.
Be among the best. Keep your pages smaller than 500K.
Mobile, Performance, SEO
Images are correctly sized
The height and width attributes of the element should match the pixel dimensions of the graphic, or the graphic should be resized to match the height and width set in the HTML. If a graphic is bigger than the assigned image attributes, you’re showing the user less than they are downloading. If the graphic is smaller than what is assigned, then the image will scale up and look pixelated. In any case, when web browsers resize images, it does not look ideal.
Content, HTML, Optimization
Google Library APIs are used when possible
To benefit from common scripts cached by browsers, you should use the Google Library APIs whenever possible. As an example, over 85% of sites use JQuery, and this 20K-ish script does not need to be re-downloaded for every single site.
However, always have a local fallback when linking external scripts that may be included locally.
All images have height and width set
Height and width are not officially required attributes for . However, including them guarantees faster content download. That information also helps the browser determine the viewport space for the image, making page rendering visually smoother.
Element-level styles are minimized
While you may have a good reason to write styles inline using the “style” attribute, generally it is not a good practice. In this case styles are not reusable, too specific, and the code becomes bloated and difficult to maintain. We suggest identifying common styles and including them with a style sheet.
Analytics software is monitoring site
Google Analytics or some other web analytics software should be included and used. The priority of this item depends on the type of site, but it is essential for most.
PNGs are used instead of GIFs
PNG image format was created to improve upon and replace GIF images; they compress better in most cases.* Additionally, there are patent issues around using GIFs.
We suggest PNG-8 for non-transparent images, PNG-24 for transparent images, JPEG for photos, and GIF for animated web graphics.
* An image would need to be very small for GIF to be the better choice.
Site is HTML5, the evolving standard
If this is a site under development, versus a retired page of content, confirm it is an HTML5 page, using the HTML5 doctype: <!DOCTYPE html>
Content prints well or a print style sheet is included
CSS reset is used
CSS resets remove inconsistent default styling, making all browsers style page elements the same way. If you want to achieve a predictable look across browsers, and save time testing and tweaking, we suggest using a CSS reset. Here’s a collection of css reset options.
Ajax is cached
ETags are configured
CSS expressions are not used
It’s unlikely your code has this boogeyman. However, if your front-end code is from 2005, you might want to check under the bed for it. I’m not going to explain why it should not be used because I don’t even remember.
CSS, Performance, Uncommon
Site has no duplicated code
Pages do not have avoidable redirects
A redirect might make a URL such as http://treefrogs.com into http://www.treefrogs.com or http://treefrogs.com/ (simply adding the forward slash). Redirects slow down web sites, so remove any redirects that are not required.
All elements have correct cursor on hover
IDs are unique to a page
IDs must be unique to an HTML document.
CSS files are minified
We recommend that CSS files larger than 5K have whitespace removed. Search “minify CSS.”
Custom fonts are lightweight and justified
Font files can be very large — commonly 1MB. If your custom font does not compress well, and you do not use it much on your site, you might decide it’s not worth slowing down your page. For example, if you use a bold version of a font in only one place, consider if the cost of loading it is worth it.
Some external services can help with managing font file size sizes, and may possibly serve cached fonts. Two to consider are Google Web Fonts and Typekit.
It is not a good idea to load a custom font to make your logo — it is much more efficient to use a graphic instead. Also, you can’t really control how or if a web font is displayed.
No class attribute values resemble HTML element names
If a class name you have selected is very similar to an HTML element name, this often indicates that your HTML can be more semantic. Use <footer>I am a footer</footer> instead of <div class=”footer”>I am a footer</div>.
Code such as <h1 class=”largeHeading”>Title</h1> is redundant since h1 means “largeHeading.” A preferable class name would be more specific and indicate how the heading is used. For example, <h1 class=”masthead”>Title</h1>, would indicate both how and where the class is used.
All images have alt tag values
Missing the alt attribute for an image may seem like a small thing, but it is important for accessibility and it is required.
!important is avoided
No site text is delivered as images
Images make pages slow; by using them you are adding http requests and files that need to be downloaded. The only time I would suggest it is for logos, which technically are text but not the type of text I’m talking about. Menus should definitely not be graphics.
Content, Optimization, SEO
document.write() is avoided
They are harmless, but if you’d like to reduce and clean up your code a bit, you can remove XHTML close tags (” />”) from elements.