3 ms·
I feel like adding an argument to the decorator that labels the "version" of the function would make deliberate cache invalidation more straightforward for cach
by Karellen 3y ago
I feel like adding an argument to the decorator that labels the "version" of the function would make deliberate cache invalidation more straightforward for cache users.
- williamzeng0 3y agoThe version input makes sense, I could also see some developers disliking that ux because of it's verbosity. But to deliberately invalidate you have to make a manual effort in either case.
- Karellen 3y agoTo me, it's more that invalidating the cache without it requires knowledge of implementation details (i.e. where the cache is stored, and how the cache files are named) that ideally shouldn't have to "leak" for the cache to be generally useful. (Buy hey, we are talking about what is famously one of the hard problems in comp sci, so (respectful) disagreements on how best to do it should be expected :-)
- williamzeng0 3y agoI appreciate the sentiment! Makes a ton of sense.