-1

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
  • Your browser will have this image in cache, so it will load faster even without angular Commented Jun 9, 2020 at 10:07

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.