Hacker News new | ask | show | jobs
by spankalee 695 days ago
A server side include wouldn't fix this problem because the SVG would be inlined everywhere. That defeats caching by duplicating the content.
1 comments

If we're talking just SVG, it could be done as a one-time inlining that uses <defs> to define shapes, that get pulled into the page later with <use>. The defs are page-wide and work across <svg> elements. That would fix the duplication, though not necessarily caching on its own with GP's include.

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/def...