N
N
NikSIk312020-06-28 08:27:11
Layout
NikSIk31, 2020-06-28 08:27:11

Is there a problem with svg in site loading?

I'm making up a site and the question arose of using svg.
Is it a problem (for site loading speed) to have svg icons in html in tagged form? Approximately as in the picture
5ef82990863db633299366.png
(and this is not the end of DELEKO
) , everything is decent in the code itself, that is, icons from the images folder are connected by name, which consists of "x -icon-name " , something like this:
<x-my-icon class="..."/>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arseny, 2020-06-28
Matytsyn @ArsenyMatytsyn

1. Do not add to the body of the site what should not be there.
2. Embedding svg in the body of the page is normal and generally good (if there is no extra garbage, of course).
3. "x-my-icon" - if this is a web component, or a component based on some thread of the Vue type, then everything is OK, otherwise it's a game.

T
ThunderCat, 2020-06-28
@ThunderCat

Ideally, this should be ONLY if it is a component generated programmatically, that is, each time different content, in other cases - take it to a file and load it from a file.
This will give a) cacheability, and b) asynchronous loading.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question