redis_page 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/action_controller/caching/redis_pages.rb +2 -1
- data/lib/redis_page/version.rb +1 -1
- data/lib/redis_page/view_helpers.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8596548ecfa19e197f56e74f3f403e77c0b9115
|
4
|
+
data.tar.gz: 4ce725f85a9d4314c79fbf47694b76d6f7b693cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 338b11c2a01ce06d708c06013f28bf43657b983f1a553eb740306f010394d74313c1442dd48dfcaf44dcb949cea3cacc12d184b8ca4278a9e7f49ad71eb49a93
|
7
|
+
data.tar.gz: 725bd98b8d926bd8e93d1b93fe6dde4555778a4d1b9e8e0ca158a44c5239c2a2cf2004c453a0e8ad66941737d566114f492687925427de36e5f6b8fa1c4dc53d
|
@@ -25,7 +25,8 @@ module ActionController
|
|
25
25
|
|
26
26
|
after_filter({only: actions}.merge(options)) do |c|
|
27
27
|
#path = request.path # fixed: /products/ 地址带了/符号,缓存不生效
|
28
|
-
path = URI(request.original_url).path
|
28
|
+
#path = URI(request.original_url).path
|
29
|
+
path = request.path
|
29
30
|
path = "#{path}-#{@cache_country}" if @cache_country
|
30
31
|
c.cache_redis_page(response.body, path, options)
|
31
32
|
c.record_cached_page
|
data/lib/redis_page/version.rb
CHANGED
@@ -22,14 +22,14 @@ module RedisPage
|
|
22
22
|
id = object.id
|
23
23
|
end
|
24
24
|
Rails.logger.info "[page cache]record: #{name}##{id}"
|
25
|
-
RedisPage.redis.sadd("i:#{name}:#{id}", { url: request.
|
25
|
+
RedisPage.redis.sadd("i:#{name}:#{id}", { url: request.base_url + request.path, country: @cache_country }.to_json)
|
26
26
|
end
|
27
27
|
|
28
28
|
# 记录类相关的页面,方便实体创建时,刷新页面缓存
|
29
29
|
def mark_cache_clazz(clazz)
|
30
30
|
name = clazz.table_name
|
31
31
|
Rails.logger.info "[page cache]class: #{name}"
|
32
|
-
RedisPage.redis.sadd("c:#{name}", { url: request.
|
32
|
+
RedisPage.redis.sadd("c:#{name}", { url: request.base_url + request.path, country: @cache_country }.to_json)
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|