Friday, 21 October 2022

React loading image locally vs using external url

Trying to understand, new to this. if I deploy a react app. If I store the images in with in the react app will it effect the speed of react app? When loading for the first time will all images be downloaded on request? If that's the case it's good to for external image?

External

  <img className="w-full rounded-lg" src="https://images.unsplash.com/photo-1551650975-87deedd944c3ixlib=rb1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2574&q=80" alt="Sunset in the mountains"></img>

Internal

import gameImg from "../../assets/images/game.jpg";

as per this question: Website images performance: local folder or external source? local images are good way. But is it the same case for the react app?



from React loading image locally vs using external url

No comments:

Post a Comment