Nice approach. I did something similar but I use Postgres, Spring Boot and Angular. In my case UI requests a list of photos from specific directory which is on my NAS. Spring Boot service then creates thumbnails on a fly using Thumbnailator component. I don’t save thumbnails on a disk, and instead I return them as data URL which can be then directly rendered in UI. Performance is not bad. Using bit of multithreading I was able to create 100 thumbnails typically in less than 5-6 seconds. In order not to delay the response, I initially return list of file names with only couple of other properties. That list then gets rendered in the browser with some default thumbnail (i.e. egg timer or similar). Then I push thumbnail data URL’s from the server to the client as they get created. Initially I used web sockets for this but then I found that server side events (SSE) are much better and simpler to implement for my use case. Once all thumbnails are received by UI it terminates SSE request.
Nice approach. I did something similar but I use Postgres, Spring Boot and Angular. In my case UI requests a list of photos from specific directory which is on my NAS. Spring Boot service then creates thumbnails on a fly using Thumbnailator component. I don’t save thumbnails on a disk, and instead I return them as data URL which can be then directly rendered in UI. Performance is not bad. Using bit of multithreading I was able to create 100 thumbnails typically in less than 5-6 seconds. In order not to delay the response, I initially return list of file names with only couple of other properties. That list then gets rendered in the browser with some default thumbnail (i.e. egg timer or similar). Then I push thumbnail data URL’s from the server to the client as they get created. Initially I used web sockets for this but then I found that server side events (SSE) are much better and simpler to implement for my use case. Once all thumbnails are received by UI it terminates SSE request.
Interesting approach as well, thanks for sharing!
Very useful tips and tricks, as always!
Finally he uploaded
thats realy awesome