diff --git a/app-tools/src/io/pedestal/app_tools/service.clj b/app-tools/src/io/pedestal/app_tools/service.clj index 7b8a4c5b8..cb8e476c0 100644 --- a/app-tools/src/io/pedestal/app_tools/service.clj +++ b/app-tools/src/io/pedestal/app_tools/service.clj @@ -14,7 +14,7 @@ [io.pedestal.service.log :as log] ;; the impl dependencies will go away ;; these next two will collapse to one - [io.pedestal.service.interceptor :as interceptor :refer [definterceptorfn]] + [io.pedestal.service.interceptor :as interceptor :refer [definterceptorfn definterceptor]] [io.pedestal.service.http :as bootstrap] [io.pedestal.service.http.impl.servlet-interceptor :as servlet-interceptor] [io.pedestal.service.http.route.definition :refer [expand-routes]] @@ -39,6 +39,11 @@ (assoc context :response (ring-response/redirect (str "http://" host ":" port uri))) context))))) +(definterceptor set-cache-control-no-cache + (interceptor/on-response + ::set-cache-control-no-cache + (fn [response] + (assoc-in response [:headers "Cache-Control"] "no-cache")))) ;; define service routes (defn dev-routes @@ -56,7 +61,8 @@ ;; sure you include routing and set it up right for ;; dev-mode. If you do, many other keys for configuring ;; default interceptors will be ignored. - ::bootstrap/interceptors [bootstrap/not-found + ::bootstrap/interceptors [set-cache-control-no-cache + bootstrap/not-found bootstrap/log-request servlet-interceptor/exception-debug middlewares/cookies