tomdesair / tus-java-server

Library to receive tus v1.0.0 file uploads in a Java server environment
MIT License
131 stars 62 forks source link

Caching UploadInfo #7

Closed Maxoid closed 6 years ago

Maxoid commented 6 years ago

I just found, that there is a huge amount of useless disk operations during request processing because of every "handler" invokes "Storage" service for the UploadInfo. Better to avoid this by providing some sort of shared "session" state between all of them.

To reduce refactoring tasks, I've implemented a simple in-memory cache for the DiskStorage. Let's see.

Maxoid commented 6 years ago

BTW, One test is failed, but I can't reproduce it locally.

Maxoid commented 6 years ago

There is no such thing as "not so slow disk"! :)

tomdesair commented 6 years ago

Good job! I like the idea of the ITTusFileUploadServiceCached!