go-pkgz / lcw

Loading Cache Wrapper
https://go-pkgz.umputun.dev/lcw/
MIT License
20 stars 5 forks source link

Add support of scopes/tags for complex invalidations #9

Closed umputun closed 4 years ago

umputun commented 4 years ago

This idea implemented in go-phgz/rest/cahce and allows to invalidate multiple records inside of some scope(s).

This is needed if some change affects multiple cached records at once. For example, an update of the user's post may also need to invalidate the cached list of recent user's posts as well as another cached list of all last posts. To achieve it two scopes should be used - last_ and "last_all_posts" and invalidate will be called with those scopes.