4 ms·
> Instead, switching back to sending small asset files for every required element consisting the webpage being request becomes an ideal approach This doesn't s
by robbles 12y ago
> Instead, switching back to sending small asset files for every required element consisting the webpage being request becomes an ideal approach
This doesn't solve the other side of the problem that spritesheets are meant to solve, namely that an individual image will not be loaded yet when the first UI element using it is displayed (e.g. in a CSS rollover, or new section of a SPA appears). I can't see a way that new protocols are going to solve this, unless I'm missing something in how HTTP2 is going to be handled by the browser?
I assume that once you're forced to preload everything you might need for the page, it's no longer more efficient to break up into multiple tiny requests.
- zub 12y ago> I can't see a way that new protocols are going to solve this, unless I'm missing something in how HTTP2 is going to be handled by the browser? HTTP/2 server push. Your server can proactively deliver things like rollover state graphics knowing that the client will need them.
- robbles 12y agogood point. I imagine determining when to push these assets will become a complex choice though. Also, I realized shortly after commenting that I missed the obvious benefit of avoiding downloading global spritesheets and other compiled assets for individual pages that only use a subset of the content.
- ncallaway 12y agoI would consider continuing to spritesheet the button itself. The main difference is that each roll-over effect can be separated from all the other spritesheets in the world. Still, an exciting time when we can combine files based on what is the most logical grouping, rather than what is the most efficient. I look forward to the day when HTTP2 rules the world.
- youngtaff 12y agoSpritesheets and other forms of asset concatenation are aiming to reduce the impact of round-trip latency and overhead of HTTP i.e repeated headers. I've always seen the "image is already loaded" as a "nice" side effect but spritesheets can have issues in mobile contexts as the whole image must be decoded jsut to access the sprite, it's unclear how effectively browsers cache the individual sprites in memory, compared to individual images too.