-
Notifications
You must be signed in to change notification settings - Fork 550
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
Add ETag sample code and Blog #929
base: main
Are you sure you want to change the base?
Conversation
0d09e53
to
8b26437
Compare
If you're looking to: | ||
|
||
1. **Reduce network bandwidth utilization for caching.** | ||
2. **Avoid the cost of transactions when working with non-atomic values in your cache store.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, we can add the case of maintaining a consistent cache with a backend database that also supports ETags.
@@ -0,0 +1,181 @@ | |||
--- | |||
slug: etags-when-and-how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to link to the blog post from the documentation page for etags.
#### High-Level Diagram | ||
``` | ||
(server 1)----[server 1 reads from cache]----(cache) | ||
| | ||
| | ||
[server 2 writes to the cache, invalidating whatever server 1 had read] | ||
| | ||
| | ||
(server 2) | ||
``` | ||
|
||
#### Sequence Diagram | ||
``` | ||
server 1 cache server 2 | ||
1. initial read from cache for k1-----------------------> | ||
2. <----------------------------------------Send Data and ETag | ||
<-------------------------update value for k1 (invalidates k1) | ||
3. second read to cache for k1 -------------------------> | ||
<--------------------------------------(What is sent back?) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these diagrams be done with Mermaid? Docusaurus seems to support it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, we're already using mermaid in the website. For example: https://microsoft.github.io/garnet/docs/dev/configuration
Blog and Sample Code as reference implementation of OCC and Cache invalidation scenario