module ContentfulRails::Caching::Timestamps::ClassMethods

Class methods for Timestamps

Public Instance Methods

clear_cache_for(item_id) click to toggle source

Clear an existing timestamp from the cache; called by the subscriber to the Entry notifications from the WebhooksController.

# File lib/contentful_rails/caching/timestamps.rb, line 17
def clear_cache_for(item_id)
  cache_key = timestamp_cache_key(item_id)

  Rails.cache.delete(cache_key)
end
timestamp_cache_key(item_id) click to toggle source

Get the cache key for the timestamp

# File lib/contentful_rails/caching/timestamps.rb, line 24
def timestamp_cache_key(item_id)
  "contentful_timestamp/#{content_type_id}/#{item_id}"
end