2

I have a web page, which always takes 2 seconds to load the SVG images when it is opened for the first time, and when the page is loaded next time, since the SVG files are cached by the browser, the page will show the SVG files immediately.

Now I want to show the loading on the page until the SVG images are loaded completely on the page, the SVG images are embedded in CSS, maybe I could do the ajax to load the image, but now the key issue is how do I know if the SVG image is cached or not, so if I know the image is cached, no need to send the request, otherwise send the request asking for the image.

user824624
  • 7,077
  • 27
  • 106
  • 183
  • This might help; http://stackoverflow.com/questions/7844982/using-image-complete-to-find-if-image-is-cached-on-chrome –  Feb 24 '14 at 17:27

1 Answers1

0

Use the Developer tools and check the networks tab and start capturing, reload the page and view the items on your list, you should see a 304 or "Not Modified" status for anything that it is using from the Cache.

Talspaugh27
  • 973
  • 9
  • 16