So we can do a few things. We can set the header on all future uploads, and run a script to set the header on all the ones that exist there. I did try this with mixed results.
But then I remembered this is a PWA, and caching images is one of the things it does really well. So I set the app to cache profile images locally through the service worker, and it seems to be working really well.
Finally got this working on the
keith-dev
branch.What's happening is that user uploads are going into the Firebase Storage bucket, and those have no Cache Control headers set:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
So we can do a few things. We can set the header on all future uploads, and run a script to set the header on all the ones that exist there. I did try this with mixed results.
But then I remembered this is a PWA, and caching images is one of the things it does really well. So I set the app to cache profile images locally through the service worker, and it seems to be working really well.
I'll push this out in the next deploy.