4 ms·
Diskcache works well, we just wanted a dependency free version that we had more control over (easier cache key deletion). I think you'd have to write a custom h
by williamzeng0 3y ago
Diskcache works well, we just wanted a dependency free version that we had more control over (easier cache key deletion). I think you'd have to write a custom hashing function for diskcache to use the function source code as a key.
I'm also unsure if Diskcache supports ignoring certain fields in the function call.
- rmholt 3y agoGood questions! You made me check the docs because those seem like very legitimate issues. So firstly, DiskCache by default just checks the function name, not the source code, but you could hack it to include the source code. I personally usually just deleted the cache if I knew the function meaningfully changed. And it does support ignoring certain args yes.
- williamzeng0 3y agoThank you for checking! That works, we could just override the key logic to check the source code (I'm guessing it's easily accessible)