Skip to content
Snippets Groups Projects
Commit e7c02a3c authored by Cam Saul's avatar Cam Saul
Browse files

Add Ring GZIP middleware. MAKES THINGS FASTER EVEN RUNNING LOCALLY <3

parent 16480499
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
[org.clojure/tools.logging "0.3.1"] ; logging framework
[org.clojure/tools.macro "0.1.5"] ; tools for writing macros
[org.clojure/tools.trace "0.7.8"] ; "tracing macros/fns to help you see what your code is doing"
[amalloy/ring-gzip-middleware "0.1.3"] ; Ring middleware to GZIP responses if client can handle it
[cheshire "5.4.0"] ; fast JSON encoding (used by Ring JSON middleware)
[clj-http-lite "0.2.1"] ; HTTP client; lightweight version of clj-http that uses HttpURLConnection instead of Apache
[clj-time "0.9.0"] ; library for dealing with date/time
......
......@@ -12,6 +12,7 @@
[metabase.util :as util]
[ring.adapter.jetty :as ring-jetty]
(ring.middleware [cookies :refer [wrap-cookies]]
[gzip :refer [wrap-gzip]]
[json :refer [wrap-json-response
wrap-json-body]]
[keyword-params :refer [wrap-keyword-params]]
......@@ -32,7 +33,7 @@
auth/wrap-sessionid ; looks for a Metabase sessionid and assocs as :metabase-sessionid
wrap-cookies ; Parses cookies in the request map and assocs as :cookies
wrap-session ; reads in current HTTP session and sets :session/key
))
wrap-gzip)) ; GZIP response if client can handle it
(defn init
......
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