Skip to content

perf: cache shared list requests and gzip API responses - #52

Merged
jonymaster merged 1 commit into
mainfrom
perf/cache-heavy-list-requests
Nov 26, 2026
Merged

jonymaster merged 1 commit into
mainfrom
perf/cache-heavy-list-requests

Conversation

@jonymaster

Copy link
Copy Markdown
Owner
  • Frontend: short-lived (30s) cache for GET /api/services/, /api/hardware/ and /api/dashboard/. Concurrent calls share one request; any write clears the cache, so pages reload fresh data after a save. The cache key includes the auth header.
  • Backend: GZipMiddleware for responses over 1 KB. List payloads shrink about 9x (services 141 KB → 16 KB with sample data).
  • Effect: Dashboard → Services → Costs → Calendar → Dashboard within 30s goes from 11 list requests to 4.

How to test: npm test (new responseCache.test.ts); pytest. In the browser, move between Dashboard, Services, Costs and Calendar and check the network tab. Save a service and confirm the list shows the change.

Dashboard, services, costs and calendar each refetch the same large lists on every visit.
@jonymaster
jonymaster merged commit ff92a24 into main Nov 26, 2026
7 checks passed
@jonymaster
jonymaster deleted the perf/cache-heavy-list-requests branch November 26, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant