rails-brotli-cache 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails-brotli-cache/store.rb +7 -4
- data/lib/rails-brotli-cache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2870c72930bbed4f3ccdc807cf5f62e692bc56456a1c456c123fc4d3b14b537c
|
4
|
+
data.tar.gz: c12a04062bdae8ca70535ca15aad9a77953dff01618d544f9bd28408e222cfde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5683b7363fc845e04739e077315fc0d0e363d8dda8fc6dcc9d3f44eb2d0ec5e8a4dc4d45ef8e6d1354f7ba669c9befae4cd30dda3f1da553eec1ed73d4e41076
|
7
|
+
data.tar.gz: 636786c88da156a5938cb8a637deebb916c354b0e0171ae0389085dae69dce5dbe10a627468432f217aaa3aba74fbdc03f957284607ab658713f2c6bbfa320fe
|
@@ -58,7 +58,7 @@ module RailsBrotliCache
|
|
58
58
|
options
|
59
59
|
)
|
60
60
|
|
61
|
-
uncompressed(payload)
|
61
|
+
uncompressed(payload, options)
|
62
62
|
end
|
63
63
|
|
64
64
|
def write_multi(hash, options = nil)
|
@@ -77,7 +77,7 @@ module RailsBrotliCache
|
|
77
77
|
names = names.map { |name| cache_key(name) }
|
78
78
|
|
79
79
|
Hash[core_store.read_multi(*names, options).map do |key, val|
|
80
|
-
[source_cache_key(key), uncompressed(val)]
|
80
|
+
[source_cache_key(key), uncompressed(val, options)]
|
81
81
|
end]
|
82
82
|
end
|
83
83
|
|
@@ -119,8 +119,9 @@ module RailsBrotliCache
|
|
119
119
|
private
|
120
120
|
|
121
121
|
def compressed(value, options)
|
122
|
-
return value if value.is_a?(Integer)
|
123
122
|
options ||= {}
|
123
|
+
|
124
|
+
return value if value.is_a?(Integer)
|
124
125
|
serialized = Marshal.dump(value)
|
125
126
|
|
126
127
|
if serialized.bytesize >= COMPRESS_THRESHOLD && !options.fetch(:compress) == false
|
@@ -136,7 +137,9 @@ module RailsBrotliCache
|
|
136
137
|
end
|
137
138
|
end
|
138
139
|
|
139
|
-
def uncompressed(payload)
|
140
|
+
def uncompressed(payload, options)
|
141
|
+
options ||= {}
|
142
|
+
|
140
143
|
return nil unless payload.present?
|
141
144
|
|
142
145
|
return payload if payload.is_a?(Integer)
|