Skip to content
Snippets Groups Projects
Unverified Commit b526a2ac authored by Danilo Campana Fuchs's avatar Danilo Campana Fuchs Committed by GitHub
Browse files

fix: Correct cache control for static js/css files (#34171)

parent a511a62e
No related branches found
No related tags found
No related merge requests found
......@@ -34,14 +34,13 @@
(defn cacheable?
"Can the ring request be permanently cached?"
[{:keys [request-method uri query-string], :as _request}]
[{:keys [request-method uri], :as _request}]
(and (= request-method :get)
(or
;; match requests that are js/css and have a cache-busting query string
(and query-string
(re-matches #"^/app/dist/.*\.(js|css)$" uri))
;; match requests that are js/css and have a cache-busting hex string
(re-matches #"^/app/dist/.+\.[a-f0-9]{20}\.(js|css)$" uri)
;; any resource that is named as a cache-busting hex string (e.g. fonts, images)
(re-matches #"^/app/dist/[a-f0-9]{20}+.*$" uri))))
(re-matches #"^/app/dist/[a-f0-9]{20}.*$" uri))))
(defn https?
"True if the original request made by the frontend client (i.e., browser) was made over HTTPS.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment