Skip to content

Slim metadata.json critical-path: factor out a metadata-summary endpoint #520

Open

Description

@neuromechanist

Problem

`data.nemar.org//metadata.json` is the long pole on the website's dataset detail SSR critical path. Measured directly from a US-West machine:

  • TTFB: 896 ms (cold)
  • Payload: 41 KB uncompressed

Most of those 41 KB are fields the page header doesn't need at SSR time:

  • `authors[]` (often dozens of entries with affiliations + ORCIDs)
  • `funding[]`
  • `related_identifiers[]`
  • `keywords[]`
  • Full `description` text

The header/Hero only needs: `name`, short `description` blurb, `recording_modality`, `tasks`, `external_links.dataset_doi`, `external_links.github_url`. About 1–2 KB worth.

Ask

Add a second endpoint that returns just the header-critical fields:

```
GET https://data.nemar.org//metadata-summary.json
-> 200 application/json
{
"id": "on005262",
"name": "...",
"short_description": "...", // first 280 chars of description
"recording_modality": ["EEG"],
"tasks": ["inner-speech"],
"license": "...",
"github_url": "...",
"dataset_doi": "...",
"openneuro_id": "ds005262", // null if NEMAR-native
"latest_version": "v1.0.0"
}
```

Target: <3 KB, <100 ms TTFB.

Full `metadata.json` continues to serve the right-rail DetailRail panel (authors, funding, etc.), which the website now fetches client-side via its own `/api/dataset//readme` and `/api/dataset//tree` endpoints (see nemarOrg/website@c15a199).

Why it matters

Combined with the recent website-side defer refactor, the detail page TTFB went from ~2.5 s to ~0.34–1.1 s. The remaining cold-page floor is exactly this `metadata.json` fetch. Slimming it would put the detail page below 300 ms cold consistently.

Implementation hint

If a separate endpoint is heavyweight to add, an alternative is a query-param projection on the existing endpoint:

```
GET //metadata.json?fields=name,short_description,recording_modality,tasks,license,external_links.dataset_doi,external_links.github_url
```

Either form unblocks the perf gain.

Related

Activity

  1. added
    enhancement
    P1
    on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions