Add warning in caching documentation

This commit is contained in:
Edward Andrews-Hodgson 2016-08-04 17:17:00 +01:00
parent 6567989ad7
commit be8f136d15

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