13 steps you need to take to improve your web site performance
Consolidate your CSS
There is no reason to have more than 3 stylesheets in your application (with a few notable exceptions). In most cases, 1 will suffice. If you have a CSS for every page, you are doing it very very wrong. CSS should be reused across multiple pages. If the page is supposed to have the same theme as another, just different content, then why have a different CSS? Refactor your CSS so that it applies across your website. This not only makes it less to download, but makes it more manageable in the long term.
What many neophyte web designers do not realize, is that every single Javascript, CSS file, and image file represents a separate HTTP call. A web page has to make multiple trips to a website, and does so serially. That means the more files from the same site, the more calls it has to make, and each call adds latency to the web page.
Consolidate your JavaScript
First, read the second paragraph above.
Second, look to see how you can reuse some Javascript functions. You might also delight in using a Javascript framework such as JQuery, or Dojo, which will make your Javascript writing more efficient, and allow you to reuse code that has already been written and perfected by someone else.
Use a CDN to host your JavaScript frameworks
Remember my comment about pulling down multiple files in serial? Well, its only serial if its from the same web site. If from another website, it can do so in parallel. If you are using a Javascript framework, you can pull it from a content delivery network (CDN) such as Google’s Hosted Library. This also means less HTTP traffic on your network, and therefor less work on your servers. Keep in mind however, that this may not work well if your target audience is behind a firewall. Some firewall might prohibit access to these sites. In such situations, you could host a CDN behind your firewall, and even host your own customized Javascript libraries (or CSS libraries).
Minify your static files
Shrink your JSP’s by moving styles into your style sheets
This is likely self descriptive, but the smaller your JSP, the less load on your application server. Move this into your CSS file. Same logic applies to Javascript functions in your JSP’s. Move those functions into your JS files. Its easier to cache static content, than JSP’s, thus taking further load off the application server. Also, only use an <img> tag if the image is part of the content. If its there for decoration, use a background-image attribute for a stylesheet.
Combine smaller images into a single sprite
width: 46px;
height: 44px;
background: url(img_navsprites.gif) 0 0;
}
Shrink your images
Replace images with CSS
Always, always, ALWAYS use an HTTP Server – never your application server transport chain
Add a caching proxy for static content
Move validation logic to the browser
Use WebSphere Dynacache or eXtreme Scale for dynamic caching
Scan and analyze your Java based web app
- 541+ provided rules
- Integrated results view with click-to-source navigation
- Explanations, examples, and quick fixes
- Supports customer rule creation based on rule templates
- Extensive context sensitive help
- Produces HTML/PDF reports with violations and violation metrics
- Supports configuration of rule sets for use in different scopes and environments
- Run interactively or invoke from command line
- Integrate with automated builds