Skip to content

Fix Stale Album Artwork and Track Data in Spotify Now Playing Card - #8429

Open
kanishka-2007-tech wants to merge 1 commit into
JhaSourav07:mainfrom
kanishka-2007-tech:bug-spotifyplaycard
Open

Fix Stale Album Artwork and Track Data in Spotify Now Playing Card#8429
kanishka-2007-tech wants to merge 1 commit into
JhaSourav07:mainfrom
kanishka-2007-tech:bug-spotifyplaycard

Conversation

@kanishka-2007-tech

@kanishka-2007-tech kanishka-2007-tech commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

app/api/spotify/route.ts:

  1. Album artwork fetch — replaced cache: 'force-cache' (indefinite,
    never revalidates) with next: { revalidate: 30 }. This still avoids
    re-downloading the image on every single request, but guarantees it
    can't be held onto indefinitely.
  2. SVG response Cache-Control — tightened from
    public, max-age=30, s-maxage=30, stale-while-revalidate=30 to
    public, max-age=10, s-maxage=10, stale-while-revalidate=10, cutting the
    worst-case staleness window from ~60s down to ~20s while still protecting
    the Spotify API from being hit on every card load.

The explicit refresh / bypassCache query params are untouched and still
force no-cache, no-store, must-revalidate for callers who want a guaranteed
live fetch.

Fixes #8278

Pillar

  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@kanishka-2007-tech is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

This PR addresses the issue of stale album artwork and track data by adjusting the caching strategy for the Spotify API. The changes ensure that the data is refreshed more frequently while still minimizing unnecessary API calls. This aligns with our previous decisions to enhance user experience through better data handling. Thank you for your contribution, and I look forward to your updates!

@retenta-bot retenta-bot Bot changed the title fix: prevent stale album artwork/track data in Spotify "Now Playing" card Fix Stale Album Artwork and Track Data in Spotify Now Playing Card Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4052.50 KB 4052.50 KB 0 B
Total CSS 338.94 KB 338.94 KB 0 B

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.

Bug: Spotify "Now Playing" SVG serves stale album artwork due to aggressive caching

1 participant