Add compression via content-encoding #12

Merged
reynir merged 1 commit from content-encoding-compression into main 2025-01-17 09:06:08 +00:00
Owner

This adds compression if the client has a compatible Accept-Encoding: header.

For the endpoint https://builds.robur.coop/job/caldav/build/6fba938d-d651-419c-b1b5-43523572e2ff/exec (~34 MB) it reduces the transfered data down to ~13 MB. However, locally, it increases the transfer time from ~0.2 s to ~2.0s! I notice that "deflate" is chosen despite curl offering "deflate, gzip, [...]". If I manually set the header to gzip only the transfer time is down at ~1.8s. I'm not sure why it adds so much overhead. With this I am unsure if it's worth it.

This adds compression if the client has a compatible `Accept-Encoding:` header. For the endpoint https://builds.robur.coop/job/caldav/build/6fba938d-d651-419c-b1b5-43523572e2ff/exec (~34 MB) it reduces the transfered data down to ~13 MB. However, locally, it increases the transfer time from ~0.2 s to ~2.0s! I notice that "deflate" is chosen despite curl offering "deflate, gzip, [...]". If I manually set the header to gzip only the transfer time is down at ~1.8s. I'm not sure why it adds so much overhead. With this I am unsure if it's worth it.
reynir added 1 commit 2025-01-17 09:00:11 +00:00
Author
Owner

Ah! The added timing is not unreasonable:

$ time gzip exec 

real	0m1.368s
user	0m1.355s
sys	0m0.012s
Ah! The added timing is not unreasonable: ```shell $ time gzip exec real 0m1.368s user 0m1.355s sys 0m0.012s ```
reynir merged commit 713912071e into main 2025-01-17 09:06:08 +00:00
reynir deleted branch content-encoding-compression 2025-01-17 09:06:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: robur/builder-web#12
No description provided.