lapis
lapis copied to clipboard
Cache Robustness
How is the caching logic implemented? The docs don't really disclose that. Specifically, is the implementation vulnerable against a cache stampede attack?
Vulnerable:
if (!inCache(key))
expensive_calc()
setCache(key)
Safe:
if (!inCache(key))
aquire_global_lock(key)
expensive_calc()
setCache(key)
release_global_lock(key)