How to Fix Safari Not Clearing Service Worker Caches on Mac

Modern progressive web apps (PWAs), interactive web clients, and cloud applications utilize Service Workers and the CacheStorage API to cache script bundles, stylesheets, and API payloads for instant offline availability. Web developers and everyday users often find that executing standard browser cache clearing—such as clicking Develop > Empty Caches or pressing Option + Command + E—fails to update web applications, leaving Safari serving obsolete JavaScript and broken UI layouts. This occurs because Safari isolates Service Worker storage containers from standard HTTP network caches.

Unregister Service Workers and Clear Storage via Web Inspector

Safari Web Inspector includes dedicated controls to terminate active worker threads and flush CacheStorage tables:

  1. Open the problematic web application in Safari.
  2. Press Option + Command + I to launch Web Inspector.
  3. Navigate to the Storage tab along the top toolbar.
  4. In the left sidebar, expand the Service Workers section.
  5. Click on the registered worker scope and click the Unregister button.
  6. Next, expand the Caches (or Cache Storage) section, right-click each cached origin container, and select Delete.
  7. Refresh the page (Command + R). Safari will fetch fresh production assets directly from the remote origin server.

Remove Website Data for the Origin in Safari Settings

If Web Inspector is unavailable or service workers continue respawning from disk:

  1. Click Safari in the macOS menu bar and choose Settings (or press Command + Comma).
  2. Switch to the Privacy tab and click Manage Website Data….
  3. Type the target website domain into the search bar.
  4. Select the domain and click Remove, then click Done.
  5. This completely purges all IndexedDB, LocalStorage, and Service Worker registration files on disk.

Purge WebKit Service Worker Directory via Terminal

To eliminate corrupted worker daemons system-wide, quit Safari, open Terminal, and run: rm -rf ~/Library/Containers/com.apple.Safari/Data/Library/WebKit/ServiceWorkers before relaunching the browser.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.