rails-brotli-cache 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/lib/rails-brotli-cache/version.rb +1 -1
- data/lib/rails-brotli-cache.rb +1 -1
- data/rails-brotli-cache.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16016a858334a3110d884e44bf6ce43fce75ac926c75973980f189a1477152b3
|
4
|
+
data.tar.gz: 58756fbc6b6da6bde9144f07352302814d638664b567ad9f51ad069073ac0b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7276bf3a52a7861fc80c3be8772c190bbc153c26b26f88c152bce44083aae5cfb294b6720d23f40a0f6766905b6b17431d7c1295781604224af9f6738741a68a
|
7
|
+
data.tar.gz: 4c784d5e0ce3fbe2c7242d875b4be25b87b2984148e54ab981d47069613d165b0065e57b0336f933e4bb7206453eb95cb66870dc2eb37d7b2bba005b52bf4e9f
|
data/README.md
CHANGED
@@ -43,8 +43,8 @@ Benchmark.bm do |x|
|
|
43
43
|
Rails.cache.write("test", json)
|
44
44
|
Rails.cache.read("test")
|
45
45
|
end
|
46
|
-
|
47
46
|
end
|
47
|
+
|
48
48
|
x.report("RailsBrotliCache") do
|
49
49
|
1000.times do
|
50
50
|
RailsBrotliCache.write("test", json)
|
@@ -65,10 +65,13 @@ end
|
|
65
65
|
You can use it just like the default `Rails.cache` API:
|
66
66
|
|
67
67
|
```ruby
|
68
|
-
RailsBrotliCache.read("test-key") => nil
|
69
|
-
RailsBrotliCache.fetch("test-key") { 123 } => 123
|
68
|
+
RailsBrotliCache.read("test-key") # => nil
|
69
|
+
RailsBrotliCache.fetch("test-key") { 123 } # => 123
|
70
70
|
RailsBrotliCache.delete("test-key")
|
71
|
-
RailsBrotliCache.read("test-key") => nil
|
71
|
+
RailsBrotliCache.read("test-key") # => nil
|
72
|
+
RailsBrotliCache.write("test-key", 123, expires_in: 5.seconds)
|
73
|
+
sleep 6
|
74
|
+
RailsBrotliCache.read("test-key") # => nil
|
72
75
|
|
73
76
|
```
|
74
77
|
|
data/lib/rails-brotli-cache.rb
CHANGED
@@ -4,7 +4,7 @@ require 'rails-brotli-cache/version'
|
|
4
4
|
require 'brotli'
|
5
5
|
|
6
6
|
module RailsBrotliCache
|
7
|
-
COMPRESS_THRESHOLD = ENV.fetch("BR_CACHE_COMPRESS_THRESHOLD",
|
7
|
+
COMPRESS_THRESHOLD = ENV.fetch("BR_CACHE_COMPRESS_THRESHOLD", 1).to_f * 1024.0
|
8
8
|
COMPRESS_QUALITY = ENV.fetch("BR_CACHE_COMPRESS_QUALITY", 5).to_i
|
9
9
|
MARK_BR_COMPRESSED = "\x02".b
|
10
10
|
@@prefix = "br-"
|
data/rails-brotli-cache.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = RailsBrotliCache::VERSION
|
9
9
|
gem.authors = ["pawurb"]
|
10
10
|
gem.email = ["contact@pawelurbanek.com"]
|
11
|
-
gem.summary = %q{ Rails cache using Brotli compression
|
12
|
-
gem.description = %q{ rails-brotli-cache allows to reduce storage needed for Rails cache by using Brotli compression which can produce outputs smaller by ~20
|
11
|
+
gem.summary = %q{ Rails cache using Brotli algorithm offers better compression and performance. }
|
12
|
+
gem.description = %q{ rails-brotli-cache allows to reduce storage needed for Rails cache by using Brotli compression which can produce outputs smaller by ~20%. }
|
13
13
|
gem.homepage = "https://github.com/pawurb/rails-brotli-cache"
|
14
14
|
gem.files = `git ls-files`.split("\n")
|
15
15
|
gem.test_files = gem.files.grep(%r{^(spec)/})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-brotli-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: " rails-brotli-cache allows to reduce storage needed for Rails cache
|
98
|
-
by using Brotli compression which can produce outputs smaller by ~20
|
98
|
+
by using Brotli compression which can produce outputs smaller by ~20%. "
|
99
99
|
email:
|
100
100
|
- contact@pawelurbanek.com
|
101
101
|
executables: []
|
@@ -180,7 +180,7 @@ requirements: []
|
|
180
180
|
rubygems_version: 3.1.6
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
|
-
summary: Rails cache using Brotli compression
|
183
|
+
summary: Rails cache using Brotli algorithm offers better compression and performance.
|
184
184
|
test_files:
|
185
185
|
- spec/dummy/Gemfile
|
186
186
|
- spec/dummy/README.md
|