heroku-deflater 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/heroku-deflater.gemspec +1 -1
- data/lib/heroku-deflater/railtie.rb +4 -0
- data/lib/heroku-deflater/skip_images.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/heroku-deflater.gemspec
CHANGED
@@ -8,5 +8,9 @@ module HerokuDeflater
|
|
8
8
|
app.middleware.insert_before ActionDispatch::Static, Rack::Deflater
|
9
9
|
app.middleware.insert_before ActionDispatch::Static, HerokuDeflater::SkipImages
|
10
10
|
end
|
11
|
+
|
12
|
+
config.after_initialize do |app|
|
13
|
+
app.config.static_cache_control ||= "public, max-age=86400"
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
@@ -9,7 +9,7 @@ module HerokuDeflater
|
|
9
9
|
def call(env)
|
10
10
|
status, headers, body = @app.call(env)
|
11
11
|
headers = Rack::Utils::HeaderHash.new(headers)
|
12
|
-
if headers['Content-Type'].start_with?('image/')
|
12
|
+
if headers['Content-Type'].to_s.start_with?('image/')
|
13
13
|
if headers['Cache-Control'].nil? or headers['Cache-Control'].empty?
|
14
14
|
headers['Cache-Control'] = 'no-transform'
|
15
15
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-deflater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
segments:
|
79
79
|
- 0
|
80
|
-
hash:
|
80
|
+
hash: 1157460233835853722
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
none: false
|
83
83
|
requirements:
|