Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <v.shushlin@gmail.com>2021-12-24 17:54:11 +0300
committerVladimir Shushlin <v.shushlin@gmail.com>2021-12-24 17:54:11 +0300
commitd40af81155fdd50f7ea3b78249cc303b91acf63e (patch)
treec1f2026e278312a91529e5dce7b47d65cb5113f1 /internal/serving
parent5e488dfd5d56127c0721c974f89319a0aedec439 (diff)
feat: enable Etag caching
Changelog: added
Diffstat (limited to 'internal/serving')
-rw-r--r--internal/serving/disk/reader.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/serving/disk/reader.go b/internal/serving/disk/reader.go
index b83425eb..5961d843 100644
--- a/internal/serving/disk/reader.go
+++ b/internal/serving/disk/reader.go
@@ -14,7 +14,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
"gitlab.com/gitlab-org/labkit/errortracking"
- "gitlab.com/gitlab-org/gitlab-pages/internal/feature"
"gitlab.com/gitlab-org/gitlab-pages/internal/httperrors"
"gitlab.com/gitlab-org/gitlab-pages/internal/logging"
"gitlab.com/gitlab-org/gitlab-pages/internal/redirects"
@@ -235,11 +234,7 @@ func (reader *Reader) serveFile(ctx context.Context, w http.ResponseWriter, r *h
http.ServeContent(w, r, origPath, fi.ModTime(), rs)
} else {
w.Header().Set("Content-Length", strconv.FormatInt(fi.Size(), 10))
- if feature.HandleCacheHeaders.Enabled() {
- vfsServing.ServeCompressedFile(w, r, fi.ModTime(), file)
- } else {
- io.Copy(w, file)
- }
+ vfsServing.ServeCompressedFile(w, r, fi.ModTime(), file)
}
return true