lib/rack/cache/options.rb in rtomayko-rack-cache-0.2.0 vs lib/rack/cache/options.rb in rtomayko-rack-cache-0.3.0
- old
+ new
@@ -59,10 +59,19 @@
# override this value.
#
# Default: 0
option_accessor :default_ttl
+ # Set of request headers that trigger "private" cache-control behavior
+ # on responses that don't explicitly state whether the response is
+ # public or private via a Cache-Control directive. Applications that use
+ # cookies for authorization may need to add the 'Cookie' header to this
+ # list.
+ #
+ # Default: ['Authorization', 'Cookie']
+ option_accessor :private_headers
+
# The underlying options Hash. During initialization (or outside of a
# request), this is a default values Hash. During a request, this is the
# Rack environment Hash. The default values Hash is merged in underneath
# the Rack environment before each request is processed.
def options
@@ -109,10 +118,11 @@
@default_options = {
'rack-cache.verbose' => true,
'rack-cache.storage' => Rack::Cache::Storage.instance,
'rack-cache.metastore' => 'heap:/',
'rack-cache.entitystore' => 'heap:/',
- 'rack-cache.default_ttl' => 0
+ 'rack-cache.default_ttl' => 0,
+ 'rack-cache.private_headers' => ['Authorization', 'Cookie']
}
self.options = options
end
end
end