del cache headers

master
serr 2025-04-06 12:26:16 +03:00
parent 3e340c14d2
commit 24a36b22b3
2 changed files with 1 additions and 2 deletions

View File

@ -15,7 +15,7 @@ MiddlewaresChain(m1, m2, m3)
= func(next http.Handler) http.Handler { return m1(m2(m3(final))) }
MiddlewaresChain(LoggingMiddleware)
= func(next http.Handler) http.Handler { return LoggingMiddleware(final http.Handler) }
= func(next http.Handler) http.Handler { return LoggingMiddleware(final) }
*/
func MiddlewaresChain(middlewares ...Middleware) Middleware {
return func(final http.Handler) http.Handler {

View File

@ -5,7 +5,6 @@ import "net/http"
// Обработчик статических файлов с кэшированием
func StaticHandler() http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Cache-Control", "public, max-age=31536000, immutable")
// Здесь используется встроенный файловый сервер Go (http.FileServer), который:
// Реализует интерфейс http.Handler (и поэтому имеет метод ServeHTTP)
// Автоматически обслуживает статические файлы из файловой системы