How does "Request Coalescing" work? #263
-
The docs explain that a cache stampede is avoided using "Request Coalescing", but there's no hint how that works. Does it simply lock the data-loading factory? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @lonix1 , yes that is basically it. Request Coalescing simply means that multiple requests for the same data at the same time (to be more precise: in the same small time window) are handled as logically the same. To do that, usually a lock is involved, and in FusionCache that is the case with one lock per cache key, to not block a request for product 1 when one for product 2 is being executed, and vice versa. Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi @lonix1 , yes that is basically it.
Request Coalescing simply means that multiple requests for the same data at the same time (to be more precise: in the same small time window) are handled as logically the same. To do that, usually a lock is involved, and in FusionCache that is the case with one lock per cache key, to not block a request for product 1 when one for product 2 is being executed, and vice versa.
Hope this helps.