4 ms·
I've sped up sites before by using inline svg rather than icon fonts - downloading an entire icon font for a few icons is inefficient when the actual SVG needed
by marcus_holmes 6y ago
I've sped up sites before by using inline svg rather than icon fonts - downloading an entire icon font for a few icons is inefficient when the actual SVG needed for those icons is < 1Kb and is waaay faster as inline SVG.
- foxhop 6y agoRemarkbox does this with the default profile avatar, just-in-time dynamically rendered and inlined SVGs. I've considered storing each default SVG into the user table and then inlining in the HTML but decided to wait on that optimization since inlining dynamic SVGs itself was such a significant speed boost, especially on threads with hundreds of comments. Without inlining, each profile image or SVG would be a separate request parallel HTTP request and often at least a couple requests would be slow. https://www.remarkbox.com https://www.remarkbox.com
- hypertele-Xii 6y agoIt's only faster on the first load. On all subsequent loads its slower and consumes more bandwidth. I find this irresponsible.
- mook 6y agoThat surely depends on context; for a lot of pages I'll never make a second load at all.
- postalrat 6y agoOnly if your html is dynamic and can't be cached. I find this irresponsible.
- marcus_holmes 6y ago1. If you use, say, 5 icons and there are, say, 250 icons in the full font, then you would need to download the page 50 times to just equal the bandwidth. That's assuming the cache doesn't expire, or it's not an incognito session, or you're not loading it from a CDN where it won't get cached anyway. 2. If you do find this irresponsible, then by all means create a small SVG file with the 5 icons in it and allow that to be cached, or even 5 small individual SVG files if it comes to that.