finds.dev← search

// the find

jakearchibald/trained-to-thrill

★ 329 · JavaScript · Apache-2.0 · updated Apr 2017

Trains! Yey!

A demo app from Jake Archibald showing how to build an offline-first web app with Service Workers — specifically a train departure board that caches Flickr photos so it keeps working with no network. It's a teaching artifact, not a library: there's nothing here to install into your own project, just source to read.

The service worker source (src/js/sw/index.js) is a real, readable example of cache-then-network and stale-while-revalidate patterns from someone who literally wrote the spec explainers. It demonstrates runtime caching of third-party API responses (Flickr), which most SW tutorials skip in favor of trivial static-asset caching. Small enough codebase that you can read the whole thing in one sitting.

Dead since 2017 — Service Worker APIs, Workbox, and browser cache behavior have moved on, so treat anything here as historical reference, not current best practice. No tests, no CI beyond a stale .travis.yml, and the build is gulp-based, which is itself a relic. Zero documentation beyond 'open it, turn off wifi, reload' — no explanation of the caching strategy or why specific decisions were made, so you're reading code with no narrative.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →