linuxserver / docker-calibre-web

GNU General Public License v3.0
1.04k stars 145 forks source link

[FEAT] Persist thumbnails cache? #295

Closed bossanova808 closed 5 months ago

bossanova808 commented 5 months ago

Is this a new feature request?

Wanted change

Calibre-web can take a long time to generate it's thumbnail cache. For my library (~5000 books), it's about 90 minutes currently but I have seen reports from others with much larger libraries of many (12+) hours. For me, in that 90 minute window, calibre-web is effectively unusable, it's so slow.

It seems the complete thumbnail generation process needs to be re-done every time the container is updated (and has to be manually kicked off, or a once-a-day scheduled task made within the admin UI).

Would it not make sense to persist this cache (inside the container at /app/calibre-web/cps/cache/thumbnails) on the host so that's it's available immediately and the work does not need to be re-done each time?

I have calibre-web on a Digital Ocean VPS, with the books/database on Cloudflare R2 via an rclone mount, which of course does not help speed-wise. However, once the thumbnails are generated, everything is very speedy.

Reason for change

Speed!

Proposed code change

Modify the docker file such that we can use a host volume for the thumbnail cache.

github-actions[bot] commented 5 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

bossanova808 commented 5 months ago

(and if not - a task at container start that kicks off the thumbnail generation automatically would at least be a useful extra!)

drizuid commented 5 months ago

I don't think that this is something we will add in, but nothing stops you from just adding another bind mount.

-v /some/persistent/path/thumbnails:/app/calibre-web/cps/cache/thumbnails

bossanova808 commented 5 months ago

Ah thanks - I didn't realise you could arbitrarily mount into the container like that, I thought it had to be specified points.

That's great, should solve the issue indeed.