This is a possible performance improvement that might be resolved on its own as part of our work in Decouple Icons from Themes.
Currently, because of lack of support in IE11 and long standing svg xlink:href is not allowed to point to an external domain we use the svg4Everybody library to polyfill SVG usage to external spritemaps.
In addition to svg4Everybody, we set use data-href instead of href to prevent an unnecessary browser request that we know might fail due to cross-server restrictions.
The proposal here would be to:
- Extract svg4Everybody to its own module
- Only load and initialize svg4Everybody when necessary
- In IE11
- When Cross Origin conditions apply, ie: icons.svg base path different than current base path
- Properly coordinate the use href and use data-href switch depending on the conditions
- The library svg4Everybody is only used when accessing DXP in:
- Any browser with the server configured to serve icons through a CDN in a different domain
- All icons remain visible in the different scenarios