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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 810b8a9a145f01f58923764d99f72e09bb2882cff72d0f8b2266c9f1a185d6d2
4
- data.tar.gz: 699d0a32134d13fc64079c5f670d4b6b66b1250667fefbe286d7321a90c482be
3
+ metadata.gz: 16016a858334a3110d884e44bf6ce43fce75ac926c75973980f189a1477152b3
4
+ data.tar.gz: 58756fbc6b6da6bde9144f07352302814d638664b567ad9f51ad069073ac0b35
5
5
  SHA512:
6
- metadata.gz: b787598548edc438572e8450410b131b7e60fbb31e070ec036d96c85db5081764c66eb45ad389598097fbbb6fa6296055c122c45844da89fad068b5d7b82e67b
7
- data.tar.gz: da03b287c5ecea11bebe57592ae13af97aa4327f2712e3cb9180e480b16a8cfbf4086f4564c4ff34b37b0f4651eccdba661c63aa01d19270f5711159dbf1c4ce
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsBrotliCache
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -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", 0).to_f * 1024.0
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-"
@@ -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 algorithm }
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.0
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 algorithm
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