Tuesday 27 March 2018

[Question] Resizing and compressing remote images

Hey guys, I've been working on a problem for quite a while.I have a website that uses images from a database, these images can be quite large (1.5MB).I've been trying to scale the images before sending them to the user... But no success.I've tried using fs.stat to check if the requested image is present if not I used fs.writeFile and after that I used sharp an NPM package for image resizing.This makes my whole website very slow.I believe this can be done by using Blob? But I'm not quite sure how, because I'm pretty new to Node.js.Could someone offer me some advice on how to do this correctly without ruining page load? :) Thanks!

Submitted March 27, 2018 at 06:43PM by Cookiemuncher69

No comments:

Post a Comment