When true, infer_extension will look up the cache path extension from the
request‘s path & format. This is desirable when reading and
writing the cache, but not when expiring the cache - expire_action should
expire the same files regardless of the request format.
[Source]
139: def initialize(controller, options = {}, infer_extension=true)
140: if infer_extension and options.is_a? Hash
141: request_extension = extract_extension(controller.request)
142: options = options.reverse_merge(:format => request_extension)
143: end
144: path = controller.url_for(options).split('://').last
145: normalize!(path)
146: if infer_extension
147: @extension = request_extension
148: add_extension!(path, @extension)
149: end
150: @path = URI.unescape(path)
151: end