SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial

The home for developers

Track your course progress, manage projects, and find your dream job - all in one place.

Start Your Free Trial

7 Day Free Trial. Cancel Anytime.

SitePoint Premium

  • Access to 700+ courses
  • Publish articles on SitePoint
  • Daily curated jobs
  • Learning Paths
  • Discounts to dev tools
  • Library/
  • Text courses/
  • A Brief Primer on Service Workers in Django
A Brief Primer on Service Workers in Django

A Brief Primer on Service Workers in Django


Course details

0∙0 Ratings0 reviews

Published
December 2019
Publisher
SitePoint
Chapters
1

About the course

Adding a service worker to your site—to make it work offline, or to make it a full PWA—can seriously help your users’ experience. A site which works offline isn’t vulnerable to suddenly not working if their train goes into a tunnel, for example. Additionally, there’s less of a concern about your JavaScript not loading, and it can seriously improve your site’s performance and bandwidth usage.

Your service worker is a JavaScript file which has access to certain privileged functions, and one of the main things it can do is enable your site to work offline by intercepting requests for HTML pages and page dependencies (CSS, JavaScript, images, and so on), and serving cached versions of those pages instead of (or as well as) the versions from the network. Thus, if the user is offline—for extended time, if they’re somewhere without wireless, or temporarily, as they step with their phone into an elevator—your site still works with no interruptions, because the cached versions of your pages are used.

In this tutorial, Stuart shows you how to add a simple service worker to your Django site, and then moves beyond the basics to show hwo you can achieve background sync.

Author

Stuart Langridge

Stuart Langridge

Stuart is a consultant CTO, software architect, and developer to startups and small firms on strategy, custom development, and how to best work with the dev team. Code and writings are to be found at kryogenix.org and social networks; Stuart himself is mostly to be found playing D&D or looking for the best vodka Collins in town.

Course Outline

Chapter 1: A Brief Primer on Service Workers

Reviews

0 total

0
0
0
0
0

Course details

0∙0 Ratings0 reviews

Published
December 2019
Publisher
SitePoint
Chapters
1

SitePoint

Stuff we do

  • Premium
  • Newsletters
  • Learning paths
  • Library
  • Forums

Contact

  • Contact us
  • FAQ
  • Publish your book
  • Write an article
  • Advertise

About

  • Our Story
  • Corporate Memberships
  • Start free trial
  • Login

Connect

  • RSS
  • Facebook
  • Twitter (X)
  • Instagram

Subscribe to our newsletter

Get the freshest news and resources for developers, designers and digital creators in your inbox each week

© 2000 – 2025 SitePoint Pty. Ltd.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Terms of usePrivacy policy