service-worker
What it does
This skill checks whether a site registers a service worker and adds caching for static files and an offline fallback where needed. It is for developers who want faster repeat visits and better mobile performance.
When to use it
- ✓When you ask the agent to add caching or offline support to a website.
- ✓When repeat visits are slow and static files are downloaded again every time.
- ✓When you are preparing a progressive web app and need a working service worker.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/service-worker/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you add a service worker to my site so it loads faster on repeat visits and still works with a weak connection?”
5 new skills a week. 1 minute to read.
How it works
The agent registers a service worker in the main script, pre-caches key static files during install, and picks a caching approach for each type of resource. It also adds an activate step that removes old caches when the site updates.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Register a service worker for caching and offline support
Service workers act as a programmable network proxy between the browser and the network. They eliminate repeated server round-trips for static assets, cut load times on repeat visits by 50–90 %, and allow the app to function at all on flaky or offline networks — which is critical for users on mobile or low-bandwidth connections.
Quick Reference
- Register a service worker in your main JavaScript entry point
- Use an install event to pre-cache critical static assets
- Choose a caching strategy (cache-first, network-first, stale-while-revalidate) per resource type
- Implement an activate event to clean up old caches on update
Check
Check whether a service worker is registered and whether it caches static assets, API responses, or provides an offline fallback.
Fix
Add a service worker registration call and implement appropriate caching strategies for static assets and navigation requests.
Explain
Explain how service workers intercept network requests and how different caching strategies trade off freshness vs. speed.
Code Review
Review the service worker file and its registration. Flag missing install/ activate lifecycle handlers, absent cache-versioning, missing fetch handlers, and any patterns that could cause stale content to be served indefinitely.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/service-worker
FAQ
What are the main caching strategies?
The skill names cache-first, network-first, and stale-while-revalidate, and suggests choosing one per resource type.
Why clean up old caches?
The activate step removes outdated cached files, so visitors do not keep seeing old versions after an update.
Can stale content cause problems?
Yes. The skill warns that some caching patterns can keep serving stale content indefinitely, so the agent reviews them carefully.
Details
Original description by the author
Use when auditing repeat-visit performance, adding offline support, or evaluating PWA readiness for a web application.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3016
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.