Skip to content

Commit 866824b

Browse files
authored
Merge pull request #91 from asfadmin/feat-zip-response
feat: add gzip compression middleware
2 parents e5c87df + 0cc0216 commit 866824b

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3232
- `TROPO-ZENITH` moved from `OPERA-S1` to new `TROPO` dataset
3333
- Added `ECMWF_TROPO` to `TROPO` dataset
3434
- Add `DISP-S1-STATIC` product type to `OPERA-S1` dataset
35-
35+
- Add gzip compression middleware
3636
------
3737
## [1.0.12](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.11...v1.0.12)
3838
### Changed

src/SearchAPI/application/application.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from fastapi import Depends, FastAPI, Request, HTTPException, APIRouter, UploadFile
1010
from fastapi.responses import Response, JSONResponse
1111
from fastapi.middleware.cors import CORSMiddleware
12+
from fastapi.middleware.gzip import GZipMiddleware
1213

1314
from .log_router import LoggingRoute
1415
from .logger import api_logger
@@ -37,6 +38,9 @@
3738
allow_headers=["*"],
3839
)
3940

41+
app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5)
42+
43+
4044
cfg = load_config_maturity()
4145
cmr_health = get_cmr_health(cfg['cmr_base'], cfg['cmr_health'])
4246

0 commit comments

Comments
 (0)