Page MenuHomePhabricator

Compress file downloads if the client sends "Accept-Encoding: gzip" and we guess the file might compress alright
ClosedPublic

Authored by epriestley on Apr 15 2020, 6:35 PM.
Tags
None
Referenced Files
F13092415: D21125.diff
Thu, Apr 25, 3:43 AM
Unknown Object (File)
Sun, Apr 21, 3:50 AM
Unknown Object (File)
Sat, Apr 20, 5:13 PM
Unknown Object (File)
Thu, Apr 11, 10:52 AM
Unknown Object (File)
Sun, Mar 31, 11:17 PM
Unknown Object (File)
Thu, Mar 28, 1:30 AM
Unknown Object (File)
Mar 23 2024, 12:52 PM
Unknown Object (File)
Mar 14 2024, 6:27 PM
Subscribers
None

Details

Summary

Ref T13507. We currently compress normal responses, but do not compress file data responses because most files we serve are images and already compressed.

However, there are some cases where large files may be highly compressible (e.g., huge XML files stored in LFS) and we can benefit from compressing responses.

Make a reasonable guess about whether compression is beneficial and enable compression if we guess it is.

Test Plan
  • Used curl ... to download an image with Accept-Encoding: gzip. Got raw image data in the response (as expected, because we don't expect images to be worthwhile to recompress).
  • Used curl ... to download a text file with Accept-Encoding: gzip. Got a compressed response. Decompressed the response into the original file.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Apr 15 2020, 6:53 PM
This revision was automatically updated to reflect the committed changes.