summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mulk/benki/main.clj8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mulk/benki/main.clj b/src/mulk/benki/main.clj
index 09def98..2135b6f 100644
--- a/src/mulk/benki/main.clj
+++ b/src/mulk/benki/main.clj
@@ -26,9 +26,17 @@
(hiccup.core/with-base-url base-uri
((noir.options/wrap-options handler {:base-url base-uri}) request)))))
+(defn wrap-cache-control [handler]
+ (fn [request]
+ (let [response (handler request)]
+ (if (get-in response [:headers "Cache-Control"])
+ response
+ (assoc-in response [:headers "Cache-Control"] "no-cache")))))
+
(do-once ::init
(noir.server/add-middleware #(wrap-utf-8 %))
(noir.server/add-middleware #(wrap-base-uri %))
+ (noir.server/add-middleware #(wrap-cache-control %))
(noir.server/add-middleware #(ring.middleware.file/wrap-file % "static")))
(defonce server (doto (Thread. #(noir.server/start (:web-port @benki-config)))