mirror of
https://github.com/doocs/advanced-java.git
synced 2025-02-14 08:00:07 +08:00
docs: update redis-consistence, fix #5
Update Cache Aside Pattern Fix #5
This commit is contained in:
parent
68291c25d7
commit
ad354d4860
@ -12,7 +12,7 @@
|
||||
### Cache Aside Pattern
|
||||
最经典的缓存+数据库读写的模式,就是 Cache Aside Pattern。
|
||||
- 读的时候,先读缓存,缓存没有的话,就读数据库,然后取出数据后放入缓存,同时返回响应。
|
||||
- 更新的时候,**先删除缓存,然后更新数据库**。
|
||||
- 更新的时候,**先更新数据库,然后再删除缓存**。
|
||||
|
||||
**为什么是删除缓存,而不是更新缓存?**
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user