watermarkchurch / wcc-contentful

An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.
MIT License
2 stars 1 forks source link

Model objects should implement cache_key #122

Closed gburgett closed 5 years ago

gburgett commented 5 years ago

Similar to ActiveRecord's cache_key method we should implement cache_key and cache_version methods. This allows them to be used as keys for fragment caching. We ought to be able to cache an entire page's render tree based on the Page object's cache_key.

See https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache.rb for how these methods are used in Rails caching.