fix: badge endpoint caching (resolve #496)

This commit is contained in:
Ferdinand Mütsch 2023-07-08 18:44:40 +02:00
parent 7b60c44ac6
commit a8e2bc671d
2 changed files with 1050 additions and 1044 deletions

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,7 @@ func (h *BadgeHandler) Get(w http.ResponseWriter, r *http.Request) {
return
}
cacheKey := fmt.Sprintf("%s_%v_%s", user.ID, *interval.Key, filters.Hash())
cacheKey := fmt.Sprintf("%s_%v_%s_%s", user.ID, *interval.Key, filters.Hash(), r.URL.RawQuery)
noCache := utils.IsNoCache(r, 1*time.Hour)
if cacheResult, ok := h.cache.Get(cacheKey); ok && !noCache {
respondSvg(w, cacheResult.([]byte))