Currently ZipFile read will scan entire file to read each entry's local file header on each request for book page image.
This can be quite a slow operation depending on archive file size. In my tests 800mb archive with ~400 entries stored on hdd takes ~3 seconds on initial read on Linux system.
After initial read OS will cache file and subsequent reads become really fast ~50-100ms, but in my opinion it's better to not rely on OS for caching
If we only read central directory header entry retrieval takes ~100-150ms instead of 3 seconds which is about 30 times faster
The downside to only reading central directory is that filename can use Unicode extra field and that field is (for some reason) only added to local file header.
In that case retrieving entry might fail and we fallback to iterating each entry local file header and set name from Unicode extra field if it exists
I've also updated Apache Compress library version which deprecated ZipFile constructor calls and replaced it with Builders
Currently ZipFile read will scan entire file to read each entry's local file header on each request for book page image. This can be quite a slow operation depending on archive file size. In my tests 800mb archive with ~400 entries stored on hdd takes ~3 seconds on initial read on Linux system. After initial read OS will cache file and subsequent reads become really fast ~50-100ms, but in my opinion it's better to not rely on OS for caching
If we only read central directory header entry retrieval takes ~100-150ms instead of 3 seconds which is about 30 times faster The downside to only reading central directory is that filename can use Unicode extra field and that field is (for some reason) only added to local file header. In that case retrieving entry might fail and we fallback to iterating each entry local file header and set name from Unicode extra field if it exists
I've also updated Apache Compress library version which deprecated ZipFile constructor calls and replaced it with Builders