SitePoint
  • Blog
  • Forum
  • Library
  • Login
Join Premium
  1. Details
  2. Creator
  3. Content
  4. Reviews
  5. FAQ
A Brief Primer on Service Workers in Django Cover

A Brief Primer on Service Workers in Django

Created by

Stuart Langridge

Published by

SitePoint

Last Updated

19 December 2019

Details

Stuart shows you how you use service workers in your Django applicattions, which can have a serios beneficial impact on your users' experience. As well as the site continuing to work, service workers can improve your site's performance and bandwidth usage.

Description

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.

Creator

Stuart Langridge avatar

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.
Stuart Langridge avatar

Content

1
Preview

Reviews

Log in to write a review!

Frequently Asked Questions

A Brief Primer on Service Workers in Django Cover

A Brief Primer on Service Workers in Django

  • Unlimited access to this title and 600+ others in our library

  • New titles added frequently

  • Cancel anytime

Stuff we do

  • Premium
  • Newsletters
  • Forums

About

  • Our Story
  • Terms of use
  • Privacy Policy
  • Corporate Memberships

Contact

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

Connect

© 2000 – 2024 SitePoint Pty. Ltd.

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