Checking weakref value to be null as an indicator of gc is not reliable. We probably need a finalizer for that, but all finalizers don't get called immediately at the moment (ref: https://github.com/JuliaLang/julia/pull/13995). Going without that optimization for now.
fixed an issue where cache eviction was corrupting the cache