Conversation
…-first HF Daily. First catalog GET now serves a 25-card page (card-sized teasers, no unused metadata) so cards can paint before the tail arrives. HTML is gzipped with ETag/SWR revalidation so visit bumps still run. Progress uses the snapshot instead of rebuilding the full catalog. HF Daily list GETs are cache-first with background refresh and never 503 when a day file exists. Co-authored-by: Daniel <znsoft@163.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.
Problem
After the catalog gzip/SWR pass, cold first paint on
papers.maclaw.topstill waited on a ~1.5MB lean snapshot (~495KB gzip on disk). HF Daily list GETs could block on Hugging Face fetch + catalog merge and 503 through the tunnel./papersHTML wasCache-Control: no-store.What changed
Stacked on
cursor/papers-catalog-cache-6508.Smaller first catalog payload
brief,query_hits,pdf_url,doi,filename, and unused metadata;omitemptyon empty review/local flags; authors capped at 8.GET /papers/api/catalog?offset=0&limit=25returns the first page (partial,next_offset,count= full size). Client paints those cards, then merges the tail (loadCatalogTail). Search/filter work as soon as the tail lands. FullGET /papers/api/catalogremains for compatibility.rs_papers_catalog_v2.HTML cache
GET /papersusesETag+Cache-Control: public, max-age=0, stale-while-revalidate=300+ gzip.max-age=0so revalidation still hits the server and visit bumps still run. Settings HTML staysno-store.Cheaper progress
GET /papers/api/progressuses the in-memory snapshot + live job overlay. It no longer rebuilds/overlays the full catalog (no per-paper zh/dualstat) on every 4s/30s poll.HF Daily (ported onto this stack + cache-first)
GET /papers/daily/{date}is cache-first: a local day file is returned immediately; stale days refresh in the background. Missing cache may do one short fetch; failures return an empty 200, not tunnel 503.can_managestays on progress. Client SWR viars_papers_daily_v1. Day GET no longer callscatalog()ormergeIntoCatalogon the request path.Relay
DisableCompressionfrom the previous PR is unchanged.Before / after (measured)
80-paper unique-abstract fixture (same generator as PR 26):
limit=25)Local curl (80-paper fixture,
127.0.0.1:18765):GET /papersno-storestale-while-revalidate, ETagGET /papers/api/cataloggzipGET /papers/api/catalog?offset=0&limit=25gzippartial=true,next_offset=25,count=80GET /papers/api/progressno-storeGET /papers/daily/datesgzipScaled to the public ~1.5MB / ~495KB-gzip catalog: first paint is a ~6–20KB gzip first page instead of the whole snapshot. Repeat visits: HTML 304, catalog 304 or localStorage, Daily last-day localStorage.
HF Daily stale-cache test: GET returns the local day in <2s while upstream is blocked;
from_cache+stale+ SWR headers.Public catalog stays far under the ~2MiB tunnel safety margin. Progress remains
no-storeand small.Tests
go test ./...partial/next_offset/countno-storeon catalog/HTML GETsOperator notes
No nginx change required. Relay must keep
DisableCompression: true(already on the catalog-cache tip) so gzipContent-Encodingsurvives the tunnel.Snapshot files are still auto-written (
catalog-snapshot.json+.gz). Daily caches stay under$PAPERS_DIR/hf-daily/(gitignored).Do not merge onto
mainuntil the papers stack undercursor/papers-catalog-cache-6508lands.