MM-48924 Don't cache remote_entry.js files (#21817)

* MM-48924 Don't cache remote_entry.js files

* Change caching of remote_entry.js to match root.html
Этот коммит содержится в:
Harrison Healey
2022-12-12 10:22:35 -05:00
коммит произвёл GitHub
родитель 242d7a4466
Коммит 29f29b1e5e
2 изменённых файлов: 66 добавлений и 1 удалений

Просмотреть файл

@@ -81,7 +81,11 @@ func staticFilesHandler(handler http.Handler) http.Handler {
//wrap our ResponseWriter with our no-cache 404-handler
w = &notFoundNoCacheResponseWriter{ResponseWriter: w}
w.Header().Set("Cache-Control", "max-age=31556926, public")
if path.Base(r.URL.Path) == "remote_entry.js" {
w.Header().Set("Cache-Control", "no-cache, max-age=31556926, public")
} else {
w.Header().Set("Cache-Control", "max-age=31556926, public")
}
if strings.HasSuffix(r.URL.Path, "/") {
http.NotFound(w, r)