aBe PaZoS SoLaTie

Make the web faster - zip it

Fri Oct 1, 2010

In mid 90s I realized most Flash swf files could be compressed using zip. The resulting file would often be 50% smaller. I sent this suggestion to Macromedia, and I was very happy when the next version of the SWF file format came out, it included LZW compression.

Google has an initiative to make the web faster. They just proposed a new lossy image file format.

I was just wondering if something like what SWF does could be also used for HTML. Imagine you pack all your JavaScript, CSS and smaller images inside a resource.zip file. Later, you would target each file inside this zip file like:

<pre>
  <link rel='stylesheet' href='resource.zip?file=/mystyle.css' type='text/css' />
  <script type='text/javascript' src='resource.zip?file=/jquery.js'></script>
  <img src="resource.zip?file=/images/blank.gif" />
</pre>

This way the browser could download all the resources with just one request. Compare this to many complex sites that make over one hundred requests to the server. CSS sprites would be something from the past.

There are some drawbacks: linking to compressed resources in other domains wouldn’t be as easy as today, and crawling by search engines would require decompressing the file first. Uploading asset groups by FTP would also be faster, but then updating a single file would require uploading the complete compressed asset file.

In any case the speed increase would probably be very noticeable if web sites downloaded most of their assets on one request, instead of making hundreds of them.

Categories: text Tags: css html idea internet software Places: unimportant