4 ms·
To add to the excellent answer from SiliconAlley, it's definitely something to balance. What you cache needs to take a non-insignificant amount of time to be wo
by gingerlime 7y ago
To add to the excellent answer from SiliconAlley, it's definitely something to balance. What you cache needs to take a non-insignificant amount of time to be worth caching. Typically those DB queries for the cache key itself are single-digit ms and the stuff you want to cache is in the hundreds of ms.
Don't forget that even fetching the cache data itself takes time, even with fast cache storage like redis, especially over the network (where some cache layers live when they are shared).