robcast / digilib

A versatile image viewing environment for the internet.
https://robcast.github.io/digilib/
GNU Lesser General Public License v3.0
18 stars 7 forks source link

Fix issue with cache on fast growing repositories #26

Closed abollini closed 4 years ago

abollini commented 4 years ago

We hit this issue when a process were adding lot of images in the same subfolder of the digilib directory requesting the image just after having added it (in our case using a symblink so the process was also faster). When the read occur in the same second than the previous successful read digilib report a wrong 404.

For example having 10 images at time 0sec we put image 1 in digilib and request a small thumbnail of it few ms after we put image 2 in digilib, the request to get a thumbnail fails with a 404 at time 1sec we repeat the request and the thumbnail is successful generated

The idea of the patch is to store the read time (truncated to the sec accuracy) instead than the last modified time reported by the filesystem to check future validity of the cache