Open cyphercodes96 opened 6 years ago
@arkon or if there is someway we can persist current cache feature to more then just a session lifetime, that would be awesome!
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? :/
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?