Homestyx hydra
Diffusion hydra 3573170dfacb

Compress file downloads if the client sends "Accept-Encoding: gzip" and we…

Description

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

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.

Maniphest Tasks: T13507

Differential Revision: https://secure.phabricator.com/D21125

Details

Provenance
epriestleyAuthored on Apr 15 2020, 2:28 PM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:d86506052cff: Update a very old Phriction migration which incorrectly uses "save()"
Branches
Unknown
Tags
Unknown

Event Timeline