Skip to content

feat: batch-fetch CMS data with retry logic to reduce API calls#816

Merged
partha6686 merged 3 commits intomasterfrom
feat/cms-retry-logic
Mar 10, 2026
Merged

feat: batch-fetch CMS data with retry logic to reduce API calls#816
partha6686 merged 3 commits intomasterfrom
feat/cms-retry-logic

Conversation

@partha6686
Copy link
Contributor

@partha6686 partha6686 commented Mar 5, 2026

Summary

  • Add cached data fetchers with promise-based singletons to prevent duplicate concurrent fetches during prerender (~2,680 API calls → ~15)
  • Add retry with exponential backoff on all CMS/API calls (ECONNRESET, ETIMEDOUT, 5xx)
  • Centralize base URLs in constants/urls.js with env var overrides
  • Lazy-load grouped_by_category endpoint so it's only fetched once during page rendering
  • Increase prerender concurrency from 5 to 15

Test plan

  • Run npm run build and verify all routes generate successfully
  • Check console logs for cache hit messages and reduced API call count
  • Spot-check rendered pages (home, blog post, template, feature, category) for correct content
  • Verify retry logic by checking log output format on transient failures

- Add cached data fetchers (getAllBlogs, getAllFeatures, getAllPages, getRecommendedTemplatesMap) with promise-based singletons to prevent duplicate concurrent fetches
- Add retry with exponential backoff on all CMS/API calls (ECONNRESET, ETIMEDOUT, 5xx)
- Centralize base URLs in constants/urls.js with env var overrides
- Rewrite page components to use cached data instead of individual API calls
- Lazy-load grouped_by_category endpoint (only fetched when category pages render)
- Increase prerender concurrency from 5 to 15
@netlify
Copy link

netlify bot commented Mar 5, 2026

Deploy Preview for formester ready!

Name Link
🔨 Latest commit b7edd4f
🔍 Latest deploy log https://app.netlify.com/projects/formester/deploys/69afcadcecad9a0008a2376c
😎 Deploy Preview https://deploy-preview-816--formester.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@partha6686 partha6686 merged commit 4b4b64b into master Mar 10, 2026
4 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