You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.
I am currently using the following code to load my SVG Images from the assets folder inside my project directory.
[inlineSVG]="'/assets/Compression/' + position + '.svg'"
After loading my images for the first time, i need to push them into an array and save them to localStorage
Now my question, how can i load them back using that array that'll be fetched back from the localStorage?
The text was updated successfully, but these errors were encountered:
I still need to think about this but why aren't you setting the cache control on the SVG assets instead? The browser can handle that perfectly fine without any of this manual caching logic.
I still need to think about this but why aren't you setting the cache control on the SVG assets instead? The browser can handle that perfectly fine without any of this manual caching logic.
Could you elaborate more on what you meant by setting the cache control on the SVG assets instead?
I followed up with the docs, did some initial implementations using nginx as the server.
I added the headers Cache-Control: public and now i see a max-age header on each and every SVG request.
However, when I cache the SVG images using [cacheSVG]="true", on a session base, the load up quickly and in a really fast way.
However, now after setting the cache control on the SVG assets, monitoring the network tab in dev tools, I find out that at first, the SVG images are taking around 600ms to be loaded, EACH, and after the load, the 600ms load time is changed back to 5ms
Somehow, the inlineSVG is loading up the svg images on a normal basis, even if the cache exists, and after that, it's somehow rendering the cached images.
I still notice very slow load time, approximately 18 seconds for my component to load up, having 52 SVG's, each SVG is around ~ 180KBS, a few are ~500KBS
Any extra thoughts you share to help me out here? :/
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The title says it all.
I am currently using the following code to load my SVG Images from the assets folder inside my project directory.
[inlineSVG]="'/assets/Compression/' + position + '.svg'"
After loading my images for the first time, i need to push them into an array and save them to localStorage
Now my question, how can i load them back using that array that'll be fetched back from the localStorage?
The text was updated successfully, but these errors were encountered: