redis_page 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca34a65fad4d82697b64958c392f84f54c5a7220
4
- data.tar.gz: 5f235b7466183a10295e0cf1e8ba8f50c444e93e
3
+ metadata.gz: 12fe8841ebb2226842483c46aefb06112e0d47b9
4
+ data.tar.gz: c9eb24aaba8f066cb27a104769482f6c1d75fd4f
5
5
  SHA512:
6
- metadata.gz: a793ddfc618feb599959ff60a83bb231cc3c6862440737a21795bfadc14b90ca602bdbad251cf6ce53bbc5784cd779e4bf4e864ae6ddae8ff25847572050584f
7
- data.tar.gz: f5e8990060bf822e4c06f54ab5acdd77755db14f419b636150bb2808f949c38ff969b79391500352b730314cb33ca3c1c48a049eb8b973ee8045c7b6fc0e3696
6
+ metadata.gz: af2dcd6a121d123001c696c6b23e27549680df8a4d82296fb844e08cedc1ea4946da7ef941b00d5c5279744870a4876f1fa84bc9a3061907a36a8cc348c059ea
7
+ data.tar.gz: 40663eda1b7f8bdcaa03a73d15e7902b3e4f015e001eab6b34a83598ad7b0626581384cf50a445425ac9b1a15ab2fcd84604b8d27e1f570027a61254d29ae91f
data/README.md CHANGED
@@ -49,7 +49,9 @@ end
49
49
 
50
50
  ```
51
51
  class ProductController < ActionController::Base
52
- caches_redis_page :show
52
+ caches_redis_page :show # 或者使用下面两行的格式
53
+ #caches_redis_page :show, append_country: true # cache key 会在 path 后面加上国家代码,例如:/products-US
54
+ #caches_redis_page :show, unless: Proc.new { params[:preview] } # 带上 preview 参数,则不进行缓存,方便管理员对未保存的内容进行预览
53
55
 
54
56
  def show
55
57
  @product = Product.find(params[:id])
@@ -45,10 +45,14 @@ module RedisPage
45
45
 
46
46
  def fetch_infos(urls)
47
47
  urls.values.each do |info|
48
- Rails.logger.info "[page cache]add sweeper job: #{info['url']}-#{info['country']}"
49
- SweeperWorker.perform_async(info['url'], info['country'])
48
+ RedisPage::Sweeper.sweep info
50
49
  end
51
50
  end
52
51
  end
52
+
53
+ def self.sweep(info)
54
+ Rails.logger.info "[page cache]add sweeper job: #{info['url']}-#{info['country']}"
55
+ SweeperWorker.perform_async(info['url'], info['country'])
56
+ end
53
57
  end
54
58
  end
@@ -1,3 +1,3 @@
1
1
  module RedisPage
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - saberma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2015-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport