module Responders::HttpCacheResponder

def do_http_cache!

def do_http_cache!
  timestamp = resources.map do |resource|
    resource.updated_at.try(:utc) if resource.respond_to?(:updated_at)
  end.compact.max
  controller.response.last_modified ||= timestamp if timestamp
  head :not_modified if fresh = request.fresh?(controller.response)
  fresh
end

def do_http_cache?

def do_http_cache?
  get? && @http_cache != false && ActionController::Base.perform_caching &&
    persisted? && resource.respond_to?(:updated_at)
end

def initialize(controller, resources, options = {})

def initialize(controller, resources, options = {})
  super
  @http_cache = options.delete(:http_cache)
end

def persisted?

def persisted?
  resource.respond_to?(:persisted?) ? resource.persisted? : true
end

def to_format

def to_format
  return if do_http_cache? && do_http_cache!
  super
end