about summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2020-07-08 17:20:37 +0200
committertoonn <toonn@toonn.io>2020-07-08 17:27:34 +0200
commitf9e0a77f6711ba111b15fcbfa58d7d84d0804232 (patch)
treef637d0bd6d7e72b4a61771b889afaeea450461b4 /doc
parentd6853cbfb8e05a63afe626e8dbc2ed191d838b9b (diff)
downloadranger-f9e0a77f6711ba111b15fcbfa58d7d84d0804232.tar.gz
Add path to cache hash
Without the `st_dev` the `st_ino` is no longer enough to uniquely
identify a file. A disadvantage of including the mtime in the hash is
that changed previews don't overwrite the old cache path so the cached
grows faster.

We use the path to the file to uniquely identify a device. We
concatenate it with the `st_ino` which ensures that replacing a file is
not enough to cause a collision. This is hashed to create the cache
path. Every time we check whether a preview is cached we verify that the
file being preview is as old or older than the cached preview.

The only differences from the original scheme are the algorithm (SHA-512
now), accepting previews of with the same mtime as the original file and
including the inode identifier in the hash.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions