Skip to content

Instantly share code, notes, and snippets.

@joaomdmoura
Created October 20, 2014 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joaomdmoura/f85a38fe10c1723f00e1 to your computer and use it in GitHub Desktop.
Save joaomdmoura/f85a38fe10c1723f00e1 to your computer and use it in GitHub Desktop.
AMS Cache Support Proposal
class PostSerializer < ActiveModel::Serializer
cache cache_key: 'my-posts', expires_in: 3.days
attributes :title, :body
has_many :comments
url :post
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment