about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-25 15:09:40 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-25 15:09:40 +0100
commit318886287b289a8caccf19102da8584453ef7faa (patch)
treeb3cf78d9c9b52c750aa3539072158fc49081c9e6 /config
parent36f3da3cde2bc2148e156a5dd09d732a06b44ddd (diff)
Fixing some stuff for Turbolinks, adding gzip on top, fixing a n+1 query
Diffstat (limited to 'config')
-rw-r--r--config/application.rb1
-rw-r--r--config/initializers/rack-mini-profiler.rb6
2 files changed, 7 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb
index 1fbd8f7f6..7d6182ecc 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -37,5 +37,6 @@ module Mastodon
     end
 
     config.middleware.use Rack::Attack
+    config.middleware.use Rack::Deflater
   end
 end
diff --git a/config/initializers/rack-mini-profiler.rb b/config/initializers/rack-mini-profiler.rb
new file mode 100644
index 000000000..b1d45e257
--- /dev/null
+++ b/config/initializers/rack-mini-profiler.rb
@@ -0,0 +1,6 @@
+require 'rack-mini-profiler'
+
+Rack::MiniProfilerRails.initialize!(Rails.application)
+
+Rails.application.middleware.delete(Rack::MiniProfiler)
+Rails.application.middleware.insert_after(Rack::Deflater, Rack::MiniProfiler)