The reason that these secondary page assets are so critical for page performance is two-fold. First, there are many more of them for each page than the single HTML file. This means more HTTP connections have to opened and closed, more files have to be transfered from the server to the user’s computer. This takes a lot of time. Second, most of these assets tend to be static, they don’t change very often. This means we can cache them.
Reduce the number of assets
The first thing we need to do is to try to reduce the number of secondary assets which need to be loaded. You can try to simplify the page design to require less assets, reduce the number of images used, replace images with text (which is more accessible and search engine friendly anyhow), etc… Also reducing large files like videos and Flash files can make a significant improvement on page load times. Personally, for things other than video players and similar things, I strongly dislike the use of Flash. There is an impressive amount of rich interface and interaction that can be created using DHTML and AJAX. It generally performs better, loads faster, and is easier to make search engine friendly.
We can also reduce the number of images we request by using CSS Sprites. This is method of putting a number of small images into a single large image and referencing the images based on the coordinates. The downside is that you have to manage/edit the images within the single large image file. The upside is you can dramatically reduce the number of HTTP requests for images to build the page.
Reduce file sizes
We need to also reduce file sizes, if we can. Images, Flash files, video files, etc… should all be examined to ensure they are encoded for the minimal size possible and to still maintain the quality needed.
If you’re using ATG on DAS, you can use this ATG pipeline Servlet I create to set the cache related headers easily. If you are using JBoss as your application server then you’ll want to look at this cache header managing Servlet filter that I wrote.
At this point the user’s browser should be requesting fewer, smaller secondary assets to display the webpage, and should only be requesting them once (per expiration time period-week or day). Not only does this make pages load much more quickly, but with the use of caching the static content on the browser, you’ve dramatically reduced the number of HTTP requests that hit the server, thus freeing up your web application cluster to handle more users and page requests on the same hardware. Plus it reduces your bandwidth used, which can save money.