Monday 27 March 2017

Caching images with fs or service workers? (x-post from r/electronjs)

Hi! I'm currently working on an Electron app which will display dozens of images returned from a JSON response, and one of the project requirements is to cache those images to view offline. What would be the best way to cache those images?Originally I had thought about making a proxy server that intercepts image requests, saves the image if it doesn't already exist, and then returns the contents of the local file. However, I just found out about service workers, which sounds like it could automatically take care of all that caching overhead.Also, am I going about this the right way, or is there another option I'm not considering? I'm pretty new to the whole Node/Electron eco-system, so I'd be open to a different, better-suited methodology as well.Any advice or pointers would be very much appreciated!

Submitted March 27, 2017 at 03:59PM by mrfusion2000

No comments:

Post a Comment