memcached expiration time

前端 未结 8 1940
面向向阳花
面向向阳花 2020-12-29 08:46

Memcached provides a cache expiration time option, which specifies how long objects are retained in the cache. Assuming all writes are through the cache I f

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 09:50

    Expiration times are useful when you don't need precise information, you just want it to be accurate to within a certain time. So you cache your data for (say) five minutes. When the data is needed, check the cache. If it's there, use it. If not (because it expired), then go and compute the value anew.

    Some cached values are based on a large set of data, and invalidating the cache or writing new values to it is impractical. This is often true of summary data, or data computed from a large set of original data.

提交回复
热议问题