Skip to content

Conversation

chocolatkey
Copy link
Member

@chocolatkey chocolatkey commented Sep 20, 2024

Previously, the CompressedResource interface was added, to possibly stream resources in their original compressed format, to avoid having to decompress responses server-side before sending to the client.

This PR adds the ReadCompressed function to that interface, so that resources are not just streamed, but can also be read as a []byte in compressed form.

It also now adds GZIP versions of the stream/read functions directly in the toolkit, to make sending responses to clients that do not support deflate possible. This is particularly useful when placing the server behind a CDN like Cloudflare, that does not send deflate in its accept-encoding header.

@chocolatkey chocolatkey changed the title Add ReadCompressed function to CompressedResource Add more functions to CompressedResource Sep 21, 2024
@mickael-menu mickael-menu merged commit 9305ff9 into develop Oct 9, 2024
4 checks passed
@mickael-menu mickael-menu deleted the feature-read-compressed branch October 9, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants