Sign into your Cozi account: Sign In

« Multiple Firefox Profiles: Run Firefox 2 and 3 Side-By-Side, and More | Main | JavaScript Error Tracking: Why window.onerror Is Not Enough »

April 08, 2008

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341ca8a653ef010535c5efe2970c

Listed below are links to weblogs that reference Combining JavaScript and CSS files for Improved Performance:

Comments

James

This is a really interesting article, I was thinking about implementing a resource combiner much like this one. Is the code available for this or is it something internal you just wanted to blog about?

All the same, very cool stuff guys.

Mark Atherton

Thanks James, we are considering making the code available but right now we're just too busy.

If more people are interested, do let us know.

Thanks.

Marco

Nice article! Code samples would be nice, how did you solve requirement 4, versioning?

Thanks

Mark Atherton

We handled versioning with the 'ver' parameter. When the control generates the link to the combiner handler it includes this ver parameter.

We don't actually use the ver parameter ourselves, it's just there so that each version of the files gets cached individually by the browser.

The control calculates the 'ver' parameter by hashing together the last-modified-time of all the component files.

rob cherny

I'd love to see the source code if you get around to posting it ...

Greg Woods

Very nice. I've been looking into how to set far future expires headers on css and js files. This is a very elegant solution, with the added benefit of script combining. I can't believe there's no easy way to do it .net out of the box.
p.s. I would love to look at the source for the ashx

Andrew Ramsden

Great solution!

Another Gotcha: In order to get the most out of this technique, it will be important to remember to include every required script/stylesheet for every page of your site/application in the combiner on every page.

An alternative would be to only bundle your main (core) script/stylesheet files in this way, then add page-specific files separately.

This is important because each time the combined script URL changes (for example: if its different for each page), the browser will need to download whole combined file again. This may result in worse performance than if you just left the files as separate references.

Keep up the good work!

kiko

Just what I was looking for! Any plans to release this to the public?

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Subscribe

Cozi Tech Blog RSS Feed Cozi RSS XML Feed

Other Cozi Blogs

  • Cozi Connection Blog
    Visit the Cozi Connection Blog for the latest information about Cozi (the company) and tips about Cozi (the software).
  • flow|state
    The user interface blog by Cozi co-founder Jan Miksovsky.

Advertisement