CSS Sprites are Stupid - Let's Use Archives Instead (Firefox Demo)
kaioa.com
kaioa.com
Other browsers don't yet support it, but they don't support archives yet either. As it stands, CSS Sprites are really the only cross-browser compatible option we have, and we're going to have to make do with them.
I like your idea, but it appears to me that this is better implemented on the HTTP layer.
Archives/sprites/etc. are better in some ways than pipelined requests. Consider the case where the client is making a conditional GET request and the content hasn't changed on the server. If the content is bundled into a single resource, then you just have a single request and a single HTTP 304 response with no body. But if the content is served as multiple resources, then you have the exact same conversation repeated once for each resource. For a site with 100 images, this will use 100x the bandwidth and take nearly 100 times as long.
Since you brought up the caching issue, when you change any resource in the bundle, you are going to have to redownload the whole bundle. The bigger the bundle the more likely that one of the resources inside might need to be updated over time. With pipelining you only have to retransmit modified resources. This is not even considering the higher likelihood that larger objects have of getting thrown out of the cache.
Also, most of the overhead in establishing a connection over a non-negligible latency internet connection is in the TCP handshake. Not in the time spent transmitting a few packets of headers.
Your other points are good ones, which is why I said that bundling beats pipelining in some ways. Obviously you should measure your real-world use cases and performance before deciding.
The situation becomes even worse with TLS, in which the handshake is even more of a time sink. Too many requests on an https page is absolute death for performance! This technique could really help that.
Pipelining would certainly help, though, if and when it finally "arrives".
If this offers nothing other than a performance increase, where is the issue?
Color me surprised.
Assuming the HTML is compressed, wouldn't this also achieve the same "poor-man's pipelining" result, as in less server connections? It seems to have broader browser support than the JAR thing.
Edit: I found this too... the MHTML method linked in this article is also interesting: http://danielmclaren.net/2008/03/embedding-base64-image-data...
I have been putting off spending some time creating a script like this, mostly because I am pretty sure there is already one out there that does it.
If anything like this is ever standardized, which seems unlikely, and implemented in all the major browsers, which seems even more unlikely, MAYBE in 30 years we can use it in production.
But as far as fantasies go, it's one of the cooler ones!
To be fair, the PNG spec is really bad about referring to alpha as if it were something entirely different from a color sample. I have spent way too much time thinking about PNG minutiae for a project at work...
edit: I suppose I could have read the article first
http://code.google.com/p/google-web-toolkit/wiki/ImageBundle...
The same with an absolute URL:
<img src="jar:http://kaioa.com/b/0907/test.jar!/img1.png" alt="img1" width="32" height="32"/>
my security sense is tingling...Ok so IE6 and IE7 doesnt support it... never experienced that before.
In the future, when network speed is not an issue, we should be able to send the whole web app (or page) in one packet.
One request, one response.
it is not the case that a faster network implies larger packets
I suspect you could gzip a working CP/M system into a 9000-byte Ethernet jumbogram.