Delivering Octicons with SVG
github.com
Delivering Octicons with SVG
1–10 of 16 posts
Re: Delivering Octicons with SVG
#2Re: Delivering Octicons with SVG
#3Does this cause the HTML sent over the wire to be bloated, i.e. the svg for the same icon could be repeated multiple times on the same page?
Re: Delivering Octicons with SVG
#4Re: Delivering Octicons with SVG
#5Does this cause the HTML sent over the wire to be bloated, i.e. the svg for the same icon could be repeated multiple times on the same page?
Re: Delivering Octicons with SVG
#6Curious if they have any fallback for the very few browsers that can't render inline svg.
Re: Delivering Octicons with SVG
#7Does this cause the HTML sent over the wire to be bloated, i.e. the svg for the same icon could be repeated multiple times on the same page?
There are other techniques for client side-templated sites that will cache SVG icon data. For example, angular material's icon service [2] does this.
[1] https://css-tricks.com/svg-sprites-use-better-icon-fonts/
[2] https://material.angularjs.org/latest/api/service/$mdIconPro...
Re: Delivering Octicons with SVG
#8Does this cause the HTML sent over the wire to be bloated, i.e. the svg for the same icon could be repeated multiple times on the same page?
I expect that gzip would make the over the wire price for repeated icons insignificant.
The repetitions would have to appear within 32KB of each other to be captured in the DEFLATE window [1] which, given that a lot of pages can be 100s of KBs of uncompressed text, may make that impossible.
Additionally, the zlib (or whatever) compression settings would have to be set aggressively enough to identify those duplicates as the best run-lengths to encode. Since GitHub is generating a lot of this live and delivering with low TTFB, they may be using a less aggressive than necessary setting.
[1] https://en.wikipedia.org/wiki/DEFLATE#Duplicate_string_elimi...
Re: Delivering Octicons with SVG
#9Re: Delivering Octicons with SVG
#10I see a bug in repository page: http://i.imgur.com/GdyeFXK.png