Skip to content

morca ui: keep data reads at a named snapshot; a missing snapshot is 404 - #548

Merged
winding-lines merged 3 commits into
mainfrom
ui-data-cache
Nov 19, 2026
Merged

winding-lines merged 3 commits into
mainfrom
ui-data-cache

Conversation

@winding-lines

Copy link
Copy Markdown
Contributor

Crawlers ask the Data tab for snapshots again and again, many of them expired: each one ran morca_maintain data for 1–2 s and came back 400 (iceberg: no snapshot with id …).

  • A read at a snapshot the table hasn't is now 404 (page, data.json, data.csv): morca_maintain data checks the metadata and says "status": 404. Other mistakes in the request stay 400.
  • morca._internal.web.cache: the UI keeps answers to data reads at a named ?snapshot= by visitors not logged in (200s and those 404s), LRU by bytes (MORCA_UI_DATA_CACHE_MB, 64; 0 is off), 10 minutes at most. A hit says X-Morca-Cache: hit, counts toward the client's rate and takes no data-read slot.

Tests: tests/test_data_cache.mojo (hit, 404, LRU eviction, replace, too big, off at 0, expiry); tests/dataview.sh (404 for page/JSON/CSV; a repeat read is a hit with the same body; not kept without a snapshot, with a session, or at 0); tests/ui_drain.sh start line.

🤖 Generated with Claude Code

https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6

winding-lines and others added 3 commits November 19, 2026 06:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
@winding-lines
winding-lines merged commit 74eb8ba into main Nov 19, 2026
35 checks passed
@winding-lines
winding-lines deleted the ui-data-cache branch November 19, 2026 15:20
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