Skip to content

A platform for community discussion. Free, open, simple.

DEV: Allow browser to cache stylesheets in development (#41736)

David Taylor10087b16b724
diff --git a/app/controllers/stylesheets_controller.rb b/app/controllers/stylesheets_controller.rb
index 0f808f1bfcc..b147a3b8669 100644
--- a/app/controllers/stylesheets_controller.rb
+++ b/app/controllers/stylesheets_controller.rb
@@ -81,13 +81,9 @@ class StylesheetsController < ApplicationController
end
end
- if Rails.env.development?
- response.headers["Last-Modified"] = Time.zone.now.httpdate
- immutable_for(1.second)
- else
- response.headers["Last-Modified"] = stylesheet_time.httpdate if stylesheet_time
- immutable_for(1.year)
- end
+ response.headers["Last-Modified"] = stylesheet_time.httpdate if stylesheet_time
+ immutable_for(1.year)
+
send_file(location, disposition: :inline)
end