Preload images into memory for fast delivery with Node/Express

Viewed 83

I know the browser can cache images, but they need to be loaded at least once by fetching them from the server's storage. On the other hand, all the examples I see about serving static files with Express make use of express.static and other methods which fetch the images from a directory in the disk (HDD or SSD).

My app/website has only a bunch of small PNG, thus I was wondering if there is any npm module or technique to preload the images into memory when the app starts for fast delivery when a user requests them, since the access from the memory is much quicker than from the disk.

0 Answers
Related