Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@ Configuration will be read from `config/cache.yml` or `config/solid_cache.yml`.
The format of the file is:

```yml
default:
store_options: &default_store_options
shared:
store_options:
max_age: <%= 60.days.to_i %>
namespace: <%= Rails.env %>
size_estimate_samples: 1000

development: &development
development:
database: cache
store_options:
<<: *default_store_options
max_size: <%= 256.gigabytes %>

production: &production
production:
databases: [production_cache1, production_cache2]
store_options:
<<: *default_store_options
max_size: <%= 256.gigabytes %>
```

The `shared` key is read by Rails' `config_for` and deep merged into the configuration of every environment, with the environment's own values taking precedence.

For the full list of keys for `store_options` see [Cache configuration](#cache-configuration). Any options passed to the cache lookup will overwrite those specified here.

After running `solid_cache:install`, `environments/production.rb` will replace your cache store with Solid Cache, but you can also do this manually:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
default: &default
shared:
store_options:
# Cap age of oldest cache entry to fulfill retention policies
# max_age: <%%= 60.days.to_i %>
max_size: <%%= 256.megabytes %>
namespace: <%%= Rails.env %>

development:
<<: *default

test:
<<: *default

production:
database: <%= ENV.fetch("DATABASE", "cache") %>
<<: *default
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,15 @@ class SolidCache::InstallGeneratorTest < Rails::Generators::TestCase
private
def expected_cache_config
<<~YAML
default: &default
shared:
store_options:
# Cap age of oldest cache entry to fulfill retention policies
# max_age: <%= 60.days.to_i %>
max_size: <%= 256.megabytes %>
namespace: <%= Rails.env %>

development:
<<: *default

test:
<<: *default

production:
database: cache
<<: *default
YAML
end
end
Expand Down
Loading