We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0b01f9 commit 7fb2721Copy full SHA for 7fb2721
1 file changed
internal/http/routes/bookmark.go
@@ -165,10 +165,19 @@ func (r *BookmarkRoutes) bookmarkThumbnailHandler(c *gin.Context) {
165
return
166
}
167
168
+ etag := "w/" + model.GetThumbnailPath(bookmark) + "-" + bookmark.ModifiedAt
169
+
170
+ // Check if the client's ETag matches the current ETag
171
+ if c.GetHeader("If-None-Match") == etag {
172
+ c.Status(http.StatusNotModified)
173
+ return
174
+ }
175
176
options := &response.SendFileOptions{
177
Headers: []http.Header{
178
+ {"Cache-Control": {"no-cache , must-revalidate"}},
179
{"Last-Modified": {bookmark.ModifiedAt}},
- {"ETag": {"w/" + model.GetThumbnailPath(bookmark) + "-" + bookmark.ModifiedAt}},
180
+ {"ETag": {etag}},
181
},
182
183
0 commit comments