Skip to main content

html_response

Function html_response 

Source
pub fn html_response(
    html_br: &'static [u8],
    etag: &str,
    if_none_match: Option<&[u8]>,
    accept_encoding: Option<&str>,
) -> Response
Expand description

Serve brotli-compressed HTML with ETag support. If the client accepts br encoding, the raw compressed bytes are sent; otherwise they are decompressed. Returns 304 if the client’s If-None-Match matches etag.