Skip to content

Commit

Permalink
Docs for max_key_bytesize
Browse files Browse the repository at this point in the history
  • Loading branch information
djmb committed Sep 26, 2023
1 parent 2fe4528 commit 7080676
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Solid cache supports these options in addition to the universal `ActiveSupport::
- `clusters` - and Array of Hashes for multiple cache clusters (ignored if `:cluster` is set)
- `active_record_instrumentation` - whether to instrument the cache's queries (default: `true`)
- `clear_with` - clear the cache with `:truncate` or `:delete` (default `truncate`, except for when Rails.env.test? then `delete`)
- `max_key_bytesize` - the maximum size of a normalized key in bytes (default `1024`)

For more information on cache clusters see [Sharding the cache](#sharding-the-cache)
### Cache trimming
Expand Down Expand Up @@ -236,5 +237,10 @@ ActiveSupport.on_load(:solid_cache_entry) do
end
```

### Index size limits
The SolidCache migrations try to create an index with 1024 byte entries. If that is to big for your database, you should:

1. Manually change in the index size in the migration
2. Set `max_key_bytesize` on your cache to the new value
## Contributing
SolidCache is MIT-licensed open-source software from 37signals, the creators of Ruby on Rails.

0 comments on commit 7080676

Please sign in to comment.