How to properly serve SVG files from crossorigin?
retained text
<!-- SC_OFF --><div class="md"><p>On a website of mine I use around ~50 different tiny SVG icons (1-2KB) per page which I store on a seperate subdomain where I host all my static files that I use across multiple websites.</p> <p>I am wondering what would be the best way to serve those.</p> <ul> <li><strong>SVG sprites</strong> (a single svg file with each icon wrapped in a symbol tag): Not supported from crossorigin unless weird javascript hacks are being used.</li> <li><strong>1 request per icon</strong>: Seems a bit crazy to do 50+ requests for tiny files? Even with modern http2 this seems to slow the site down and feels like it causes unecessary overhead.</li> <li><strong>Bake SVG into html</strong>: This feels the fastest, but it adds like 50kb (a bit less when gzipped) to every html page which seems unecessary as well.</li> </ul> <p>How do you do it? What is considered best practice?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Nonilol"> /u/Nonilol </a> <br /> <span><a href="https://www.reddit.com/r/webdev/comments/1tvkfha/how_to_properly_serve_svg_files_from_crossorigin/">[link]</a></span>   <span><a href="https://www.reddit.com/r/webdev/comments/1tvkfha/how_to_properly_serve_svg_files_from_crossorigin/">[comments]</a></span>
document fetched 2026-06-03 10:48