cachew
cachew copied to clipboard
support pathlib.Path
Path is a trivial wrapper around str. I guess generally think of a good way to allow adhoc mapping of simple types. Perhaps current Exception makes sense.
Wouldn't be interesting to hash & compare the actual file it refers to see if it has changed, to invalidate the cache?
That way, promensia index
could benefit if nothing has changed on disk.
Yep, this is the idea! Even the stat().st_mtime
is probably a good proxy for the file modification time?
It's possible to support something like it, for example: https://github.com/karlicoss/HPI/blob/ed47e98d5c85b3334b3be059ad31b82c6fc0d19c/my/emfit/init.py#L27-L33
Another example (which Promnesia already benefits from) is caching org-mode files -- it makes incremental indexing pretty instantaneous on my computer, at least
https://github.com/karlicoss/HPI/blob/e81dddddf083ffd81aa7e2b715bd34f59949479c/my/orgmode.py#L78-L81
but would be nice to make it 'native'!