You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes "Connection Pool Options" a subsection of "Configuration",
instead of a subsection of "ActiveSupport::Cache::Store". This also
makes "Custom Cache Stores" its own section after all of the built-in
stores, instead of a subsection of "ActiveSupport::Cache::Store".
Copy file name to clipboardExpand all lines: guides/source/caching_with_rails.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -373,21 +373,6 @@ Alternatively, you can set `ActionController::Base.cache_store` outside of a con
373
373
374
374
You can access the cache by calling `Rails.cache`.
375
375
376
-
### `ActiveSupport::Cache::Store`
377
-
378
-
[`ActiveSupport::Cache::Store`][] provides the foundation for interacting with the cache in Rails. This is an abstract class, and you cannot use it on its own. Instead, you must use a concrete implementation of the class tied to a storage engine. Rails ships with several implementations, documented below.
379
-
380
-
The main API methods are [`read`][ActiveSupport::Cache::Store#read], [`write`][ActiveSupport::Cache::Store#write], [`delete`][ActiveSupport::Cache::Store#delete], [`exist?`][ActiveSupport::Cache::Store#exist?], and [`fetch`][ActiveSupport::Cache::Store#fetch].
381
-
382
-
Options passed to the cache store's constructor will be treated as default options for the appropriate API methods.
*`:timeout` - This option sets the number of seconds to wait for a connection (defaults to 5). If no connection is available within the timeout, a `Timeout::Error` will be raised.
413
398
414
-
#### Custom Cache Stores
399
+
###`ActiveSupport::Cache::Store`
415
400
416
-
You can create your own custom cache store by simply extending
417
-
`ActiveSupport::Cache::Store` and implementing the appropriate methods. This way,
418
-
you can swap in any number of caching technologies into your Rails application.
401
+
[`ActiveSupport::Cache::Store`][] provides the foundation for interacting with the cache in Rails. This is an abstract class, and you cannot use it on its own. Instead, you must use a concrete implementation of the class tied to a storage engine. Rails ships with several implementations, documented below.
419
402
420
-
To use a custom cache store, simply set the cache store to a new instance of your
421
-
custom class.
403
+
The main API methods are [`read`][ActiveSupport::Cache::Store#read], [`write`][ActiveSupport::Cache::Store#write], [`delete`][ActiveSupport::Cache::Store#delete], [`exist?`][ActiveSupport::Cache::Store#exist?], and [`fetch`][ActiveSupport::Cache::Store#fetch].
422
404
423
-
```ruby
424
-
config.cache_store =MyCacheStore.new
425
-
```
405
+
Options passed to the cache store's constructor will be treated as default options for the appropriate API methods.
0 commit comments