Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

targeted cache invalidation #44

Closed
umputun opened this issue May 19, 2018 · 1 comment
Closed

targeted cache invalidation #44

umputun opened this issue May 19, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@umputun
Copy link
Owner

umputun commented May 19, 2018

The current implementation is not any smart and invalidates cache entirely on any write/change.

some obvious places to make it smarter:

  1. invalidate an affected site (multi-site configurations only)
  2. vote/score change should invalidate post 's key(s) only
  3. for edit & delete - invalidate post, last and user's keys
  4. for pin - invalidate post's only
@umputun umputun self-assigned this May 19, 2018
umputun added a commit that referenced this issue May 25, 2018
@umputun
Copy link
Owner Author

umputun commented May 25, 2018

This was done with the scopes defining compound keys and flush via deletes. With the current go-cache it is impossible to get just the keys (without copying the cache map) and I had to maintain a parallel set of active keys and sync with go-cache via they eviction event. All of this seems to work ok.

@umputun umputun closed this as completed May 25, 2018
@umputun umputun added this to the v1.0.0 milestone May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant