You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not much, but there are other shortcodes which use more heavy icons, like the BrowserCompat shortcode made available for both sites with #41. This is used 17x on https://web.dev/learn/css/pseudo-classes/#hover, adding 18,4KB of SVG code to the site for each instance, totalling in 312,8KB.
Other pages on web.dev that use BrowserCompat more than 2x:
By introducing a helper that keeps track of the used icons per page, we could avoid shipping duplicate bytes and also improve DOM size. This would work by giving each SVG an ID and then reuse it like this:
For now #41 (comment) works around this using CSS background images with data URLs to avoid HTTP requests. Not great for maintenance, but performant at least.
The way we embed SVGs on the sites is not ideal. They are usually inlined, causing duplicate code to be shipped across the network. For example:
https://developer.chrome.com/en/docs/devtools/javascript/reference/ - which uses the Gotcha aside seven times, we inline the same 372 byte SVG seven times, which sums up to 2,54KB of which 2,17KB could be saved.
Not much, but there are other shortcodes which use more heavy icons, like the
BrowserCompat
shortcode made available for both sites with #41. This is used 17x on https://web.dev/learn/css/pseudo-classes/#hover, adding 18,4KB of SVG code to the site for each instance, totalling in 312,8KB.Other pages on web.dev that use BrowserCompat more than 2x:
By introducing a helper that keeps track of the used icons per page, we could avoid shipping duplicate bytes and also improve DOM size. This would work by giving each SVG an ID and then reuse it like this:
The text was updated successfully, but these errors were encountered: