Module: Granola::Caching

Included in:
Serializer
Defined in:
lib/granola/caching.rb

Overview

Mixin to add caching-awareness to Serializers.

Instance Method Summary collapse

Instance Method Details

#cache_keyObject

Public: Provides a key that's unique to the current representation of the JSON object generated by the serializer. This will be MD5'd to become the ETag header that will be sent in responses.

Returns a String or `nil`, indicaing that no ETag should be sent.


11
12
# File 'lib/granola/caching.rb', line 11

def cache_key
end

#last_modifiedObject

Public: Provides the date of last modification of this entity. This will become the Last-Modified header that will be sent in responses, if present.

Returns a Time or `nil`, indicating that no Last-Modified should be sent.


19
20
# File 'lib/granola/caching.rb', line 19

def last_modified
end