Skip to content

Commit

Permalink
App-tools now serves every request with Cache-Control: no-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Neufeld committed Mar 29, 2013
1 parent 56ea79f commit e856f8f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app-tools/src/io/pedestal/app_tools/service.clj
Expand Up @@ -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]]
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e856f8f

Please sign in to comment.