Skip to content

Commit

Permalink
add documentation for feature
Browse files Browse the repository at this point in the history
  • Loading branch information
skatkov committed Sep 22, 2023
1 parent c47448f commit 3f06ea1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ To use as a Rails cache store, simply use a new instance.
config.cache_store = ActiveSupport::Cache::DatabaseStore.new
```

## Variable Compression
By default this gem doesn't use any compression to store records, but there is an option to use `gzip` by providing a "compression" paramater. e.g


```
cache(project, compression: 'gzip') do
{code: 'to cache'}
end
```

There are some cases, when compression could be skipped - if value is numeric (e.g. increment/decrement counters) and when value is less than 1024 bytes. This is done to avoid unreasonable overhead on performance.

## Maintenance
After you have started caching into the database, you will likely see the database size growing significantly. It is crucial to implement an effective strategy to evict the cache from your DB.

Expand Down

0 comments on commit 3f06ea1

Please sign in to comment.