Skip to content

perf(calendar): revalidate the cached events feed with conditional requests - #73

Merged
m1ngsama merged 2 commits into
mainfrom
perf/conditional-feed
Sep 26, 2026
Merged

m1ngsama merged 2 commits into
mainfrom
perf/conditional-feed

Conversation

@m1ngsama

Copy link
Copy Markdown
Member

Every launch re-downloaded the full 87 KB events feed even when nothing had changed.

  • The feed's ETag and Last-Modified are stored next to the cached feed (same directory, 0600) and sent with the next request through @nbtca/nbtcal 0.4.3.
  • On 304 the calendar already parsed from the cache is reused without re-parsing; on 200 both files are replaced. Corrupt or missing metadata means an unconditional request, so a stale cache can never be pinned by a 304.
  • Against a local server with ETag support, the second launch transfers 235 bytes instead of 87,294. The live feed starts answering 304 once perf: compress the feed and answer unchanged requests with 304 calendar#6 ships its ETag; until then requests behave as today.
  • The offline fallback is unchanged.

@m1ngsama
m1ngsama merged commit 34676d7 into main Sep 26, 2026
4 checks passed
@m1ngsama
m1ngsama deleted the perf/conditional-feed branch September 26, 2026 13:12
@m1ngsama m1ngsama mentioned this pull request Sep 26, 2026
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