PWA served from NGINX not updating

I created a expo project, and did expo build:web and copied the web-build to the root folder for the NGINX server. It served up the PAW just fine, I did a tweak and repeated my steps but the old PWA still shows up. If I stop the NGINX server, the PWA on the phone still runs.

I did expo build:web -c and updated and restarted NGINX and it still serves the old PWA.

Caching the PWA on the client, in my case Chrome, Edge on MacOS and Safari on an iPhone.

How do you update a PWA once it’s deployed?

Thank you,

Warren

I modified the nginx.config:

location /service-worker.js {
root /var/www/web-build;
add_header Last-Modified $date_gmt;
add_header Cache-Control ‘no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0’;
if_modified_since off;
expires off;
etag off;
}

And after I cleared the old cache, when I do a build the phone/web browser reflect that.

3 Likes

Glad to hear you got things figured out. Big thanks for sharing the solution with the community! :clap:

Thanks for the tip, I was looking for this!
However, refreshing multiple times seemed to do the trick for my app :stuck_out_tongue:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.