Hacker News new | ask | show | jobs
by xg15 3491 days ago
It's an interesting technical exercise, but I don't think this is the right approach for optimizing HTML load times.

If the goal is to reduce latency for small images, wouldn't it make it more sense to extend data URIs so the same base64 string can be referenced in multiple places?

Actually, as HTTP2 can effectively return multiple resurces in the answer of one request, do we still need embedded images for latency reduction at all?

1 comments

Compression takes care of exactly this.
Unless compression cannot be used: https://news.ycombinator.com/item?id=13049898

Also, there are still cases where compression cannot be applied, e.g. if a script naively queries innerHTML. (This wouldn't affect loading time but it could inflate the page's RAM unnecessarily)

Sure, but I'd consider those edge cases to be situations where the treatment is worse than the disease
HTTPS is an edge condition? Over 50 percent of the web is now transferred via HTTPS.
It's not HTTPS. It's HTTPS cross-site requests with secret cookies.