I have a couple of SVG backgrounds on a site. Their size are less than 50kb, however, they load slow, or also, they seem to load as last element on the website. Since they are on the header of the page, I don't want a blank space while the image loads. I have been trying to find an answer or a reason to why this happens and optimize the svgs but can't seem to find a solution. My backgrounds are for about 2-3 secs white and then the SVGs appears.
I'm loading the SVG inline in CSS
This is what I have on my html
<div class='header-main'>
<div class="header">
<hr></hr>
<h1 class="tagline">Some Text</h1>
</div>
</div>
and the CSS loading the SVG is:
.header-main {
background: url('{{ asset "/img/background-main.svg"}}');
}