Learn the vocabulary of intercepting network requests to enable an offline-capable web experience.
0 / 5 completed
1 / 5
At standup, a dev mentions a script that runs separately from the page itself, intercepting network requests so a cached response can be served even when the device has no network connection. What is this script called?
A service worker runs separately from the page itself, intercepting a network request so a cached response can be served even when the device has no network connection at all. A regular page script only runs while the page's own tab is open and can't intercept a network request independently of that page's lifecycle. This independent interception is what lets a service worker enable a genuinely offline-capable experience, not just a page that happens to load quickly.
2 / 5
During a design review, the team wants a cached response served immediately while the service worker simultaneously fetches a fresh copy in the background to update the cache for next time. Which capability supports this?
A stale-while-revalidate caching strategy serves a cached response immediately for fast perceived performance, while the service worker simultaneously fetches a fresh copy in the background to update the cache for the next request. A cache-only strategy always serves the cached response and never fetches a fresh copy at all, which risks the cached content growing stale indefinitely. This background-revalidation approach is what balances immediate speed against eventually staying up to date.
3 / 5
In a code review, a dev notices the service worker's cache name includes a version identifier that's bumped on every deploy, with the old, differently-named cache explicitly deleted during activation. What does this represent?
Cache versioning bumps the cache name's version identifier on every deploy and explicitly deletes the old, differently-named cache during activation, ensuring an old cached asset doesn't persist indefinitely after the app has moved on. Reusing the exact same cache name across every deploy, with no versioning, risks serving an outdated asset alongside newly deployed ones. This versioning discipline is what keeps a service worker's offline cache from silently drifting out of sync with the actual deployed application.
4 / 5
An incident report shows users kept seeing a broken, outdated version of the site for days after a fix had already shipped, because the service worker's cache had no versioning and never invalidated the older cached assets. What practice would prevent this?
Bumping the cache's version identifier on every deploy and deleting the old cache during activation ensures users pick up the newly deployed assets rather than continuing to be served the stale ones from before. Reusing the same cache name with no version bump is exactly what left users stuck on the broken, outdated version in this incident. This versioning-and-cleanup step is a mandatory part of any service worker setup that caches an application's own assets.
5 / 5
During a PR review, a teammate asks why the team uses a stale-while-revalidate strategy instead of a strict cache-first strategy with no background revalidation at all. What is the reasoning?
A strict cache-first strategy with no revalidation risks serving an increasingly stale response indefinitely, since nothing ever triggers a background fetch to refresh what's cached. Stale-while-revalidate keeps the immediate speed advantage of serving from cache while still fetching a fresh copy in the background, gradually keeping the cache current. The tradeoff is that a user can still occasionally see one stale response before the background-fetched update takes effect on a subsequent request.
What does the "Service Worker Offline Caching Vocabulary" vocabulary exercise cover?
This exercise tests real IT vocabulary related to service worker offline caching vocabulary through 5 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 5 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — this module shares real-world context with 11 other vocabulary modules. See "Related vocabulary" below to keep building a connected skill set.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.