module Roda::RodaPlugins::Public::RequestMethods

def public_serve_compressed(server, path, suffix, encoding)

be called if the client will accept the related encoding.
Serve the compressed file if it exists. This should only
def public_serve_compressed(server, path, suffix, encoding)
  compressed_path = path + suffix
  if public_file_readable?(compressed_path)
    s, h, b = public_serve(server, compressed_path)
    headers = response.headers
    headers.replace(h)
    unless s == 304
      headers[RodaResponseHeaders::CONTENT_TYPE] = ::Rack::Mime.mime_type(::File.extname(path), 'text/plain')
      headers[RodaResponseHeaders::CONTENT_ENCODING] = encoding
    end
    halt [s, headers, b]
  end
end