module Rack::JQuery::Helpers

Bits of code that were being duplicated in each rack-jquery* library.

Constants

TEN_YEARS

Ten years in seconds.

VERSION

Public Instance Methods

caching_headers( etag, last_modified ) click to toggle source

Build the headers for caching. @param [String] etag @param [String] last_modified @return [Hash]

# File lib/rack/jquery/helpers.rb, line 17
def caching_headers( etag, last_modified )
  {
    "Last-Modified" => last_modified,
    "Expires"    => Rack::Utils.rfc2109(Time.now + TEN_YEARS),
    "Cache-Control" => "max-age=#{TEN_YEARS},public",
    "Etag"          => etag,
    'Content-Type' =>'application/javascript; charset=utf-8'
  }
end