rails-brotli-cache 0.3.3 → 0.3.4

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: 93b71dde73a988ed1a008810be38e9b30311896e41cf3c6017feebbfce4fec32
4
- data.tar.gz: c3c9b8da01d4e3bcadd33fca01a3648b591db18dc807536190f43f34a4af2159
3
+ metadata.gz: 412dc55dcd3f00210f9c090472b3dfcf10bedba7c2882015a74349797bfe4197
4
+ data.tar.gz: 7f8085d5fc354f899db174cf6080ea5f03a06f97a714afbb56b9f05aee801a2e
5
5
  SHA512:
6
- metadata.gz: 33648f7e5a975d4c87ea10356e2ea5dc5220ade8d6a188ba3891a5387b47506079d4f4c7763f61458663868835e16f721489cd16132cd6ca671807531f14f0cc
7
- data.tar.gz: 27d9f9b5c42134eccd351807bfd44f4d6fcc19baae2ef13a466f013c95406971feab785bced3c82827a709342f4a0672b7dee0e012f2f7c2003fac267daf7d43
6
+ metadata.gz: 539de77bdcf9cd35b99023859a8e9c8d4cb25c99161ea32699a11818ec45f38165bf29bc7a738fb57e6ee39c8774460b9e2b8a626e77cbf1ed597b3178e6e0c4
7
+ data.tar.gz: 18326136e7fe619a5af79e6bb3ea803a0656a06aacdf624c7c5f8fd2ef7d175a1a9b24583675b96155e5dd3fc8e838b2dee4bdb3100366c6a799e7462c216c9d
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Rails Brotli Cache [![Gem Version](https://img.shields.io/gem/v/rails-brotli-cache)](https://badge.fury.io/rb/rails-brotli-cache) [![CircleCI](https://circleci.com/gh/pawurb/rails-brotli-cache.svg?style=svg)](https://circleci.com/gh/pawurb/rails-brotli-cache)
2
2
 
3
- This gem enables support for compressing Ruby on Rails cache entries using the [Brotli compression algorithm](https://github.com/google/brotli). `RailsBrotliCache::Store` offers better compression and performance compared to the default `Rails.cache`, regardless of the underlying data store. The gem also allows specifying any custom compression algorithm instead of Brotli.
3
+ This gem enables support for compressing Ruby on Rails cache entries using the [Brotli compression algorithm](https://github.com/google/brotli). `RailsBrotliCache::Store` offers better compression and performance compared to the default `Rails.cache` Gzip, regardless of the underlying data store. The gem also allows specifying any custom compression algorithm instead of Brotli.
4
4
 
5
5
  ## Benchmarks
6
6
 
7
- Brotli cache works as a proxy layer wrapping the underlying cache data store.
7
+ Brotli cache works as a proxy layer wrapping the standard cache data store. It applies Brotli compression instead of the default Gzip before storing cache entries.
8
8
 
9
9
  ```ruby
10
10
  redis_cache = ActiveSupport::Cache::RedisCacheStore.new(
@@ -23,8 +23,8 @@ brotli_redis_cache.write("json", json)
23
23
 
24
24
  ## Check the size of cache entries stored in Redis
25
25
  redis = Redis.new(url: "redis://localhost:6379")
26
- redis.get("json").size # => 31698
27
- redis.get("br-json").size # => 24058
26
+ redis.get("json").size # => 31698 ~31kb
27
+ redis.get("br-json").size # => 24058 ~24kb
28
28
  ```
29
29
 
30
30
  **~20%** better compression of a sample ActiveRecord objects array:
@@ -34,8 +34,8 @@ users = User.limit(100).to_a # 100 ActiveRecord objects
34
34
  redis_cache.write("users", users)
35
35
  brotli_redis_cache.write("users", users)
36
36
 
37
- redis.get("users").size # => 12331
38
- redis.get("br-users").size # => 10299
37
+ redis.get("users").size # => 12331 ~12kb
38
+ redis.get("br-users").size # => 10299 ~10kb
39
39
  ```
40
40
 
41
41
  **~25%** faster performance for reading/writing a larger JSON file:
@@ -94,6 +94,10 @@ module RailsBrotliCache
94
94
  @core_store.clear
95
95
  end
96
96
 
97
+ def self.supports_cache_versioning?
98
+ true
99
+ end
100
+
97
101
  private
98
102
 
99
103
  def compressor_class(options, default:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsBrotliCache
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-brotli-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails