Merge pull request #1872 from aldreth/update-cache-documentation

Add warning in caching documentation [ci skip]

Closes #1587
This commit is contained in:
Benjamin Fleischer 2016-08-04 11:43:57 -05:00 committed by GitHub
commit e8343a9049

View File

@ -2,6 +2,12 @@
# Caching
## Warning
There is currently a problem with caching in AMS [Caching doesn't improve performance](https://github.com/rails-api/active_model_serializers/issues/1586). Adding caching _may_ slow down your application, rather than speeding it up. We suggest you benchmark any caching you implement before using in a production enviroment
___
To cache a serializer, call ```cache``` and pass its options.
The options are the same options of ```ActiveSupport::Cache::Store```, plus
a ```key``` option that will be the prefix of the object cache