livepeer / livepeer/explorer

Reduce ENS data cache TTL from 1 week to 1 day

Open Beginner friendly
#619 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
11
Forks
26
Avg merge
11h 58m
Merged PRs (30d)
16

Description

## Problem

All three ENS API routes use `getCacheControlHeader("week")` which sets `s-maxage=604800` (7 days) + 14 days `stale-while-revalidate`. When an orchestrator or gateway updates their ENS name, description, or avatar, changes can take up to 7–21 days to appear on the Explorer.

## Proposed Change

Change `getCacheControlHeader("week")` to `getCacheControlHeader("day")` in these three files:

- `pages/api/ens-data/[address].tsx` (line 22)
- `pages/api/ens-data/index.tsx` (line 18)
- `pages/api/ens-data/image/[name].tsx` (line 51)

This gives `s-maxage=86400` (1 day + jitter) with 7-day `stale-while-revalidate`, matching the original setting before it was bumped to `"week"` in commit 40e0fe2.

## Context

The week-long cache was introduced in #216 as a cost/performance optimization to reduce L1 ENS RPC calls. A 1-day cache still provides significant caching while reducing the staleness window for orchestrator/gateway identity updates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the three ENS API route files named in the issue: pages/api/ens-data/[address].tsx, pages/api/ens-data/index.tsx, and pages/api/ens-data/image/[name].tsx. Check each cache-control call and verify that all three use the day setting, producing a one-day s-maxage and the described stale-while-revalidate window.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.