redis_page 0.1.22 → 0.1.23
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 +9 -1
- data/lib/redis_page/version.rb +1 -1
- 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: dc682c2a3a8792e53a6290589539b64aa1ceac35
|
4
|
+
data.tar.gz: a3c930353c21b04c2c007b8cbba325c67b2f04d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7594439cade2b7d77f6187767a99f6bbb8746a2e440b175eb36053e5032bfa6c1f92382988d6f34464dc874ae61d82b986f151f7d25b6e62ecdacdd79df9a95
|
7
|
+
data.tar.gz: f3b556ab7f89b497605761444c72862913f7a487b32c2cc96f772f7729081894123f512d742e3f84ae11842562079f46df78aacee40471a356e99876c33904cc
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active_support/core_ext/class/attribute_accessors'
|
2
|
+
require 'active_support/gzip'
|
2
3
|
require 'zlib'
|
3
4
|
|
4
5
|
module ActionController
|
@@ -36,7 +37,14 @@ module ActionController
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def compress_content(content)
|
39
|
-
RedisPage.compress_method
|
40
|
+
case RedisPage.compress_method
|
41
|
+
when :deflate
|
42
|
+
Zlib::Deflate.deflate(content)
|
43
|
+
when :gzip
|
44
|
+
ActiveSupport::Gzip.compress(content)
|
45
|
+
else
|
46
|
+
content
|
47
|
+
end
|
40
48
|
end
|
41
49
|
|
42
50
|
# TODO: 全球化部署时需要将一个页面写到多个redis上去,需要确保: 1. 写入速度快; 2. 确保写入成功;
|
data/lib/redis_page/version.rb
CHANGED