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
Post a Comment