redis_page 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc682c2a3a8792e53a6290589539b64aa1ceac35
4
- data.tar.gz: a3c930353c21b04c2c007b8cbba325c67b2f04d5
3
+ metadata.gz: 4fad800d7547d5b35b0836350d471b1e2d322732
4
+ data.tar.gz: 516725e7a39182cc523023de228a85e7a7a684a0
5
5
  SHA512:
6
- metadata.gz: f7594439cade2b7d77f6187767a99f6bbb8746a2e440b175eb36053e5032bfa6c1f92382988d6f34464dc874ae61d82b986f151f7d25b6e62ecdacdd79df9a95
7
- data.tar.gz: f3b556ab7f89b497605761444c72862913f7a487b32c2cc96f772f7729081894123f512d742e3f84ae11842562079f46df78aacee40471a356e99876c33904cc
6
+ metadata.gz: 9b8ea7538652f7eb91eac25624fb848ff801ab8a6ce08144d924c5b8c0a5d80caaf5533615ab674a50aec219b842ffe90210026e062509cea63b100bdaf3d073
7
+ data.tar.gz: a0a01404268ac04cb36cc0effa6bf36b26779a8ee51a91ded1dad8df8e931b2879393f52a2fc82c7842e0b4d8e4e6628420bcc091b09ebf66c6793c9515c1250
@@ -26,10 +26,7 @@ module ActionController
26
26
  end
27
27
 
28
28
  after_filter({only: actions}.merge(options)) do |c|
29
- #path = request.path # fixed: /products/ 地址带了/符号,缓存不生效
30
- #path = URI(request.original_url).path
31
- path = request.path
32
- path = "#{path}-#{@cache_country}" if @cache_country
29
+ path = [request.path, @cache_country, RedisPage.compress_method].compact.join('-')
33
30
  c.cache_redis_page(compress_content(response.body), path, options)
34
31
  c.record_cached_page
35
32
  end
@@ -1,3 +1,3 @@
1
1
  module RedisPage
2
- VERSION = '0.1.23'
2
+ VERSION = '0.1.24'
3
3
  end
data/lib/redis_page.rb CHANGED
@@ -29,7 +29,7 @@ module RedisPage
29
29
 
30
30
  # :deflate or nil
31
31
  def self.compress_method
32
- config.compress_method
32
+ [:deflate, :gzip].include?(config.compress_method) ? config.compress_method : nil
33
33
  end
34
34
 
35
35
  def self.sweeper
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_page
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - saberma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
11
+ date: 2016-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport