docs: update redis-consistence, fix #5

Update Cache Aside Pattern
Fix #5
This commit is contained in:
yanglbme 2018-12-25 16:30:23 +08:00
parent 68291c25d7
commit ad354d4860

View File

@ -12,7 +12,7 @@
### Cache Aside Pattern
最经典的缓存+数据库读写的模式,就是 Cache Aside Pattern。
- 读的时候,先读缓存,缓存没有的话,就读数据库,然后取出数据后放入缓存,同时返回响应。
- 更新的时候,**先删除缓存,然后更新数据库**。
- 更新的时候,**先更新数据库,然后再删除缓存**。
**为什么是删除缓存,而不是更新缓存?**