Adds caching

This commit is contained in:
Lou 2021-04-30 18:24:00 +02:00
commit 203c9c6696
2 changed files with 4 additions and 0 deletions

View file

@ -1,4 +1,6 @@
class ActivitySerializer
include JSONAPI::Serializer
attributes :name, :author_id, :description, :client
cache_options store: Rails.cache, namespace: 'jsonapi-serializer', expires_in: 1.hour
end

View file

@ -2,4 +2,6 @@ class UserSerializer
include JSONAPI::Serializer
attributes :email, :username
has_many :activities
cache_options store: Rails.cache, namespace: 'jsonapi-serializer', expires_in: 1.hour
end