The #1 cause: PWA build plugins
The most common cause of OTA update failures is installing a service worker or PWA build plugin. These plugins use aggressive caching strategies that intercept all network requests and serve stale content indefinitely. This prevents Despia’s native update mechanism from fetching the latest web assets.
vite-plugin-pwanext-pwa@angular/service-workerworkbox-webpack-plugin@vue/cli-plugin-pwa
Common scenario: Watermark still showing after upgrade
This is a very common and frustrating issue. You’ve been testing with Despia’s free tier, decided to upgrade to a commercial license, rebuilt your app on our deployment pipeline, downloaded the new version… and the watermark is still there. You’ve paid. You’ve rebuilt. But nothing changed! The cause: Service workers. They cached your old app version including the watermark, and they’re still serving that cached version. Our deployment pipeline built a fresh version without the watermark, but the service worker in your app never fetched it. The fix: Remove or properly configure your service worker using the solutions below. Then rebuild and reinstall the app.Common symptoms
Your application may be affected by service worker caching issues if you observe:- Changes deployed to production do not appear in the app after closing and reopening
- Users report seeing old versions of the app despite multiple restarts
- OTA updates work on some devices but not others
- The app shows outdated content even with a stable internet connection
- Force-closing and reopening the app does not load the latest version
- Browser version shows updates but native app does not
- Watermark still appears after upgrading to a commercial license
Solution 1: Remove PWA plugins entirely
The simplest fix is to remove all PWA and service worker plugins from your project.For Vite Projects
For Create React App
In yoursrc/index.js or src/index.tsx:
For Next.js
For Angular
Solution 2: Build your own service worker
If you need a service worker for web functionality, build your own instead of using a plugin. This gives you full control over caching behavior.Critical: Your service worker must listen for a cache clear message and respond appropriately when running in Despia.
Add cache clear handler to your service worker
In your service worker file (sw.js), add this message handler:
Clear cache on app load in Despia
In your app’s entry point, add this code to clear the service worker cache when running in Despia:Solution 3: Unregister service workers completely
If you don’t need service workers at all in Despia, unregister them entirely:Why service workers are unnecessary for Despia
Despia does NOT require service workers for offline functionality. If you need offline support, Despia offers a Local Server feature that provides a superior solution. Enable it in the Despia editor:- Log in to the Despia editor at https://despia.com
- Select your project
- Enable the Local Server / Offline Mode option
- Install the
@despia/localbuild plugin from: https://www.npmjs.com/package/@despia/local - Save and rebuild your app
Comparison: Service workers vs. Despia Local Server
| Feature | Service Workers | Despia Local Server |
|---|---|---|
| Offline Support | Partial, requires careful caching | Complete, works indefinitely |
| Update Reliability | Can block updates if misconfigured | Atomic updates, never blocks |
| Boot Performance | Depends on cache state | Instant, zero latency |
| Implementation | High complexity | None (enable in editor) |
| OTA Compatibility | Often conflicts | Fully integrated |
Testing OTA updates
To confirm OTA updates are working:- Make a visible change to your app (change a button color or text)
- Deploy to production
- Verify the change is live in a browser
- Force close your native app completely (not just background)
- Wait 2-3 seconds
- Reopen the app
- Verify the change appears
Tip: Display a build timestamp or version hash in your UI during testing to easily verify which version is running.
Troubleshooting checklist
Code verification
- All PWA plugins (
vite-plugin-pwa,next-pwa, etc.) removed - No
workboxreferences in codebase - Service worker cache clear code added (if keeping service worker)
- Or service worker unregister code added (if removing service worker)
Build verification
- No unexpected
sw.jsorservice-worker.jsin build output - App is built as static export (for SSR frameworks like Next.js)
Deployment verification
- Latest build deployed to production
- CDN cache cleared (Cloudflare, Fastly, Vercel, Netlify)
- Old service worker files removed from hosting
Device testing
- App fully force-closed (not just backgrounded)
- Wait 2-3 seconds, then reopen
- Changes appear immediately
- Tested on multiple devices
Common mistakes
Mistake 1: Only removing registration code
Removing registration code prevents new installations, but existing service workers persist. You must also clear caches or unregister existing workers.Mistake 2: Conditional registration
Mistake 3: Not clearing CDN cache
Old service worker files may be cached by your CDN. Purge your CDN cache after deploying changes.Mistake 4: Leaving service worker files on server
Even after removing registration, ifsw.js files remain on your server, browsers may still have them cached. Delete these files from your hosting.
Mistake 5: Server-side rendering without static export
If using Next.js or similar frameworks with SSR, you must configure a static export for Despia:Quick reference
If you have a PWA plugin installed: Remove it entirely. If you need a service worker: Build your own and add cache clearing:Remember
The golden rule: Don’t use PWA build plugins with Despia. You don’t know what code they run, and many use aggressive caching that blocks OTA updates. If you need offline support: Enable Despia’s Local Server in the editor. No code required, and it works with OTA updates. If you need a service worker: Build your own and implement theCLEAR_SW_CACHE message handler so Despia can clear the cache on app load.
Always test: Deploy a visible change, force close the app, reopen, and verify the change appears.
For support or questions, contact: support@despia.com