0

I have a question about how angular and webapps work in general;

Let's say I load image once on my landing page, and then reuse the image on another page in the same domain using router-outlet. Does this image load once for every page, or can I reuse it later for background purposes without much dalay/any at all, because the image is already loaded?

1 Answers1

0

Your question can actually be answered without considering the specific JS framework you are using: as long as your are using the same path for loading the image the image is actually taken from the browsers cache after it was initially loaded.

Please note that you can disable this behaviour temporarily while developing when you open your development tools (F12) in your browser an tick "Disable cache" in the Network tab:

enter image description here

Often the opposite of your question is the problem - how can I as a developer prevent the browser to cache an image.

marco birchler
  • 1,195
  • 1
  • 16
  • 36