Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brunokiafuka/fa65f24ed508a13a866afbd325bcdf4e to your computer and use it in GitHub Desktop.
Save brunokiafuka/fa65f24ed508a13a866afbd325bcdf4e to your computer and use it in GitHub Desktop.

How to disable page caching with create-react-app

If you currently not using a service worker resulting in old production caches being used and users not getting new versions of the app.

src/index.js

Use:

import { unregister as unregisterServiceWorker } from './registerServiceWorker'

unregisterServiceWorker();

Instead of:

import registerServiceWorker from './registerServiceWorker'

registerServiceWorker();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment