Repository navigation
perf: paginate ListEvents, gzip the HTTP responses, cache the assets - #257
Merged
Merged
Conversation
- ListEvents honours per_page and page (newest first, total in total_count); without per_page it still returns every event - The dashboard looks for the next event in the next 90 days instead of downloading the whole collection every 30 seconds - gzip on the SPA and the API (random jitter against BREACH), the MCP endpoint is left uncompressed - Hashed /assets/ are cached for a year, index.html is revalidated - One cache key for the catalog list: ['catalogs','list'] fetched the same data a second time and was not invalidated by catalog mutations - Default staleTime of 30s: changing page no longer refetches what was just loaded Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Performance pass, measured on a local base of ~8 000 events (4 changelog entries each).
events/list10 MB (whole collection,per_pageignored)immutablefor a yearper_page/page: newest first, stable order,total_countis the number of events in scope. Withoutper_pageit still returns every event, so existing clients keep working.klauspost/compress/gzhttp, already a dependency) on the SPA and the API, with random jitter against BREACH. The MCP endpoint (/mcp, may streamtext/event-stream) is left uncompressed; checked thatinitializestill answers./assets/*(content-hashed by Vite)public, max-age=31536000, immutable;index.htmland SPA routesno-cache.['catalog','list']and['catalogs','list']fetched the same data twice, and the second key was not invalidated by catalog mutations (stale service lists on the event pages after editing the catalog). One shared query inlib/queries.ts.Checks
TestListEventsPagination(pages, total, scope).MONGO_TEST_URI=… go test ./..., gosec, staticcheck: OK.build:check,build:static,npm test(27): OK.serv+web/dist: dashboard, insights, no JS error.Not in this PR
🤖 Generated with Claude Code