class Falcon::Adapters::EarlyHints
Provide an interface for advising the client to preload related resources.
def call(headers)
def call(headers) headers.each do |key, value| if key.casecmp("link").zero? and match = PRELOAD.match(value) @request.push(match[:path]) else Async.logger.warn(@request) {"Unsure how to handle early hints header: #{key}"} end end end
def initialize(request)
Initialize the early hints interface.
def initialize(request) @request = request end
def push(path, preload: true, **options)
@parameter path [String]
Advise the request that the specified path should be preloaded.
def push(path, preload: true, **options) @request.push(path) end