python - Download and serve image or store link to image? Scale + Security -


i building webapp in django allows users post links. when post link, want display thumbnail image link. right now, download first image on linked page (using beautifulsoup), store in django model, , serve model.

i wondering whether best solution, both scale , security perspective? better solution store link original image on original website, , have user's browse request image linked website?

would second solution faster , safer downloading images onto server? worried whether downloading , serving thousands of images scale, how protect app images on malicious sites.

i think best solution download first image beautifulsoups (as doing) , upload cdn (like amazonws s3, google cloud storage, etc) , save link image in model. next time view link, serve image cdn.

this solution secure , can scale up!


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -