Skip to content

Fixed: use remote cache to cache categories/market calls properly#112

Merged
damianlegawiec merged 1 commit into
mainfrom
fix/remote-cache
Apr 7, 2026
Merged

Fixed: use remote cache to cache categories/market calls properly#112
damianlegawiec merged 1 commit into
mainfrom
fix/remote-cache

Conversation

@damianlegawiec
Copy link
Copy Markdown
Member

@damianlegawiec damianlegawiec commented Apr 7, 2026

"use cache"
In-memory only
Dies with the serverless instance
Zero reads/writes in Runtime Cache dashboard

"use cache: remote"
Vercel Runtime Cache
Regional, persists across deployments
Visible in Runtime Cache dashboard

Summary by CodeRabbit

  • Chores

    • Updated Spree SDK to the latest patch version.
  • Performance

    • Optimized caching strategy for categories and markets data retrieval.

"use cache"
In-memory only
Dies with the serverless instance
Zero reads/writes in Runtime Cache dashboard

"use cache: remote"
Vercel Runtime Cache
Regional, persists across deployments
Visible in Runtime Cache dashboard
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
storefront Ready Ready Preview, Comment Apr 7, 2026 5:26pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3105716f-367f-4cb7-ad18-68af17157b19

📥 Commits

Reviewing files that changed from the base of the PR and between 1511f87 and 45c8842.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/lib/data/categories.ts
  • src/lib/data/markets.ts

Walkthrough

Updated the @spree/sdk dependency to version ^0.20.2 and modified Next.js cache directives from "use cache" to "use cache: remote" across category and market data fetchers, changing the caching strategy from local to remote while preserving cache lifetimes and tags.

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Bumped @spree/sdk version from ^0.20.1 to ^0.20.2.
Cache Configuration Updates
src/lib/data/categories.ts, src/lib/data/markets.ts
Changed Next.js cache directives from "use cache" to "use cache: remote" in cachedListCategories, cachedListMarkets, cachedResolveMarket, and cachedListMarketCountries functions, shifting caching strategy to remote while maintaining existing cache lifetimes and tags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Remote caches now take flight,
Data fetchers shining bright,
From local stores to distant shores,
SDK opens brand new doors!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: switching cache directives from 'use cache' to 'use cache: remote' for categories and markets API calls to enable proper remote caching.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remote-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@damianlegawiec damianlegawiec merged commit 16094d7 into main Apr 7, 2026
6 checks passed
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