Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.15.13] — 2026-06-04

### Performance
- **Enable gzip compression for API responses** (`app/main.py`): added `GZipMiddleware(minimum_size=1000)` after CORS. JSON responses ≥1 KB are now compressed when the client sends `Accept-Encoding: gzip`. Measured locally on prod-shaped data: `GET /specs?active=true` 38,671 b → ~6 KB (-84%), `GET /submissions/<id>/step` (STEP body) ~45 KB → ~12 KB (-73%). Dashboard cold-load (5 API calls, ~95 KB uncompressed JSON) drops to ~20 KB on the wire. Uncompressed clients (curl without flag, identity-only) receive raw bodies unchanged via standard Accept-Encoding negotiation. Same audit class as forge-dashboard PR #260 — uniquely prod-only perf-leak, invisible to test suites.

---

## [0.15.12] — 2026-06-04

### Changed
Expand Down
8 changes: 7 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.openapi.utils import get_openapi

from app.db import init_db
Expand All @@ -21,7 +22,7 @@ async def lifespan(app: FastAPI):
app = FastAPI(
title="Forge API",
description="Competitive parametric CAD benchmark — specs, submissions, leaderboard, SOTA.",
version="0.15.11",
version="0.15.13",
lifespan=lifespan,
)

Expand Down Expand Up @@ -71,6 +72,11 @@ def custom_openapi():
allow_headers=["*"],
)

# Compress JSON responses ≥1 KB. Cuts /specs?active=true from ~38 KB to ~6 KB
# on dashboard cold-load. Negotiated via Accept-Encoding; uncompressed clients
# (curl without flag) receive identity unchanged.
app.add_middleware(GZipMiddleware, minimum_size=1000)

app.include_router(specs.router)
app.include_router(submissions.router)
app.include_router(admin_router)
Expand Down
Loading