fix: prevent browser caching of API responses in MetadataInterceptor
This commit is contained in:
parent
9cc970a3ea
commit
956ae0ebc5
1 changed files with 1 additions and 1 deletions
|
|
@ -56,7 +56,7 @@ func (*MetadataInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
|
||||||
|
|
||||||
// Prevent browser caching of API responses to avoid stale data issues
|
// Prevent browser caching of API responses to avoid stale data issues
|
||||||
// See: https://github.com/usememos/memos/issues/5470
|
// See: https://github.com/usememos/memos/issues/5470
|
||||||
if resp != nil {
|
if resp != nil && resp.Header() != nil {
|
||||||
resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
resp.Header().Set("Pragma", "no-cache")
|
resp.Header().Set("Pragma", "no-cache")
|
||||||
resp.Header().Set("Expires", "0")
|
resp.Header().Set("Expires", "0")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue