Skip to content

Enhance service worker and improve performance with prefetching#38

Merged
Barata-Ribeiro merged 4 commits into
mainfrom
adjust-serwist-caching
Jul 24, 2026
Merged

Enhance service worker and improve performance with prefetching#38
Barata-Ribeiro merged 4 commits into
mainfrom
adjust-serwist-caching

Conversation

@Barata-Ribeiro

Copy link
Copy Markdown
Owner

This pull request introduces several improvements to navigation performance and service worker behavior. Prefetching is now enabled for navigation links throughout the app, which should make page transitions faster by loading resources in advance. The service worker (app/sw.ts) is enhanced with better caching strategies, including a new cache for JSON files and improved development logging and cache management.

Navigation performance improvements:

  • Added prefetch="render" to main navigation links in nav-main.tsx to speed up navigation by preloading route resources. [1] [2] [3] [4]
  • Added prefetch="viewport" to card links on calculators, converters, programming, and utilities index pages to preload resources as links enter the viewport, improving perceived performance. [1] [2] [3] [4]

Service worker enhancements:

  • Added a new runtime cache for .json files using StaleWhileRevalidate, improving offline support and reducing network requests for public JSON resources. [1] [2]
  • Enabled cleanupOutdatedCaches and improved cache expiration settings for images and JSON files.
  • Improved development experience by adding dev-only logging to service worker events and disabling logs in production.
  • On install, the service worker now proactively caches all routes listed in /routes.json for better offline support.

@Barata-Ribeiro Barata-Ribeiro self-assigned this Jul 24, 2026
@Barata-Ribeiro Barata-Ribeiro added bug Something isn't working chore Handle config, moving etc. labels Jul 24, 2026
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
utilities-webapp Ignored Ignored Jul 24, 2026 9:19am

@Barata-Ribeiro
Barata-Ribeiro merged commit 63d5246 into main Jul 24, 2026
3 checks passed
@Barata-Ribeiro
Barata-Ribeiro deleted the adjust-serwist-caching branch July 24, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chore Handle config, moving etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant