Storing pictures on site or externally?

333 views Asked by At

Hello guys I'm thinking of making a photography website just for storing high quality pictures. I know that in order to make it faster and not lose quality I can compress the pictures. Since I'm using React I know its not an advantage due to the large bundle size as is. I've always wondered if it would be better just to externally store the photos (plus it would be easier for the photographer just to upload new photos externally to update the website). Is this idea feasible or am I making it more complicated for potentially worse results? And if it is a good idea do you have any suggestions on where to store them so that I can make api request to retrieve them? P.S. I'm aware of code splitting and other optimization techniques

2

There are 2 answers

0
Amit K Khanchandani On BEST ANSWER

Store Files Externally would be the ideal solution. Also make sure to optimize those as well, As this will improve the Page Load time.

Can also check these services:

https://cloudinary.com/

https://imagekit.io/

Amazon S3

0
GhaziBenDahmane On

since you're intending to make it possible to users to upload photos, these photos will always be stored externally in regards to the react application ( a cloud service or an express web server that you create are both external to the react app itself ) and thus these won't affect your bundle size .

To answer your question i would recommend using a service instead of hosting the images yourself , consider imgur used in this example https://github.com/MiguhRuiz/react-imgur-upload