isamplesorg / isamples_inabox

Provides functionality intermediate to a collection and central
0 stars 1 forks source link

Enable the gzip middleware for faster downloads #384

Closed dannymandel closed 1 month ago

dannymandel commented 1 month ago

Fix for https://github.com/isamplesorg/isamples_inabox/issues/373

Response headers without the middleware installed:

{'date': 'Wed, 29 May 2024 20:02:43 GMT', 'server': 'uvicorn', 'content-type': 'text/plain; charset=utf-8', 'content-length': '83547', 'last-modified': 'Wed, 29 May 2024 20:02:42 GMT', 'etag': 'f0d62ed470e56a02dd35419f00b6fc97'}

And response headers with the middleware installed:

{'date': 'Wed, 29 May 2024 20:01:20 GMT', 'server': 'uvicorn', 'content-type': 'text/plain; charset=utf-8', 'last-modified': 'Wed, 29 May 2024 20:01:16 GMT', 'etag': '73d409f560d8cc129b2fc9ddd497edd1', 'content-encoding': 'gzip', 'vary': 'Accept-Encoding', 'transfer-encoding': 'chunked'}

Note the content-encoding: gzip when the middleware is there. Used the export client to do the download, verified that everything looked fine on my local machine even with the gzip enabled.

dannymandel commented 1 month ago

The expanded downloads were the same commands run twice, once with the gzip enabled and once not (they appear identical):

image