Hacker News new | ask | show | jobs
by andy_boot 2915 days ago
I have used this pattern too. I like it.

One small problem is that depending on how your threading and cache works it might be possible for the cache to be cleared after the contains call but before the get.

1 comments

Or for the put operation to finish first every time on development machines and only sometimes in production, thus creating a very tricky bug.