graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Server.Compression

Synopsis

Documentation

type EncodingType = Maybe CompressionType Source #

Accept-Encoding directives (from client) which hasura supports. Nothing indicates identity (no compression)

contentEncodingHeader :: CompressionType -> Header Source #

A map from Accept-Encoding directives to corresponding Content-Encoding headers (from server). NOTE: identity is not a valid directive for this header.

compressResponse Source #

Arguments

:: RequestHeaders 
-> ByteString 
-> (ByteString, EncodingType)

The response body (possibly compressed), and the encoding chosen

Maybe compress the response body, based on the client's Accept-Encoding and our own judgement.

compressFast :: CompressionType -> ByteString -> ByteString Source #

Compress the bytestring preferring speed over compression ratio

getAcceptedEncodings :: RequestHeaders -> Set EncodingType Source #

Which encodings can the client accept? The empty set returned here is an error condition and the server tecnically ought to return a 406.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding