From be8f136d157ab0942a41a0cb5b0d97ad6aac435c Mon Sep 17 00:00:00 2001 From: Edward Andrews-Hodgson Date: Thu, 4 Aug 2016 17:17:00 +0100 Subject: [PATCH] Add warning in caching documentation --- docs/general/caching.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/general/caching.md b/docs/general/caching.md index c379524f..9ab9d71a 100644 --- a/docs/general/caching.md +++ b/docs/general/caching.md @@ -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