diff --git a/project.clj b/project.clj index 15718ac43aca0806a76ec0aebb50c1c7233ae5ec..932e6bd18c56ce75d910cb00544dfdbd328b6d73 100644 --- a/project.clj +++ b/project.clj @@ -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 diff --git a/src/metabase/core.clj b/src/metabase/core.clj index b9cf691d30035b2f3fe9c8aa1ed15237e6e5e285..d1bd2da87d6b6d544607219d10add296db1869a0 100644 --- a/src/metabase/core.clj +++ b/src/metabase/core.clj @@ -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