active_model_serializers: Cache not working
Not sure about how the cache
method works but seems not to be working.
class CommentSerializer < ActiveModel::Serializer
cache only: [:content]
attributes :id, :content
def content
# nokogiri parsing stuff.
end
end
Even with the cache
enabled I can see some objects being allocated by the nokogiri
gem.
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 29 (13 by maintainers)
I recently upgraded my AMS gem from
0.8.3
to0.10.0.rc1
in hopes of getting some better caching functionality. I am trying to cache some App Labels and the serializer there looks like this:But I’m not seeing any caching in my local server output. Previously, in the older version of AMS, I used this caching syntax:
And there was a very clear indication in the server output showing when the db was being queried vs. a cache_read. Since switching to the release candidate and using the new caching syntax I’m not seeing any caching. Is there something else that I am missing? Some specific config?