module ActiveModelSerializers::Model::Caching

def cache_key

Defaults to the downcased model name and updated_at
def cache_key
  ActiveSupport::Cache.expand_cache_key([
    self.class.model_name.name.downcase,
    "#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}"
  ].compact)
end

def updated_at

Defaults to the time the serializer file was modified.
def updated_at
  defined?(@updated_at) ? @updated_at : File.mtime(__FILE__)
end