Closed krlmlr closed 6 years ago
Perhaps also an option that turns off writing to the cache?
"There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton"
I know from the Rails community that we invalidate caches using hashes in the cached names based on the data content. When source data is updated, the hash is updated in a table and the cached file is compared against the hash.
I think this is the kind of solution you are wanting? Something that can detect when the source data has been updated and reload the data if an update has happened, otherwise use the cache?
Currently I'm fine with a manual solution that's better than deleting the cached files. More advanced stuff goes into the directions outlined in #67.
My proposal #152 contains a function to clear the cache of one or more objects:
clear.cache(c("foo", "bar"))
will delete those variables from the cache if they exist.
It provides an interface and a simple implementation behind (just deleting the correct files from the cache directory). If more advanced stuff comes along such as cache aging, maybe this interface could be extended to incorporate those?
Currently, file has to be removed manually from
cache
subdirectory. Can we do better?Or even a config option?