alexandrunastase / json-formatter-live

json formatter live / Keyboard first, privacy-friendly, installable JSON formatter

Home Page:https://jsonformatter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Manifest URL changes

nstringham opened this issue · comments

On this line a version is appended to the end of the manifest URL

<link rel="manifest" href="manifest.json?version={version}" />

This causes browsers to think that JSON formatter is an entirely different app every time the version changes

The standard advice has been to never change the manifest URL. However there is a new id field that could also work to solve this problem

After reading the W3C spec more closely I realized that the current setup is actually spec compliant. Although it doesn't work in older browsers It does work in the latest version of Chrome and should work in future browser versions.

It would still probably be a good idea to make the manifest URL unchanging but it shouldn't be causing duplicate apps.

The reason I did it like this was because there were some issues in the past with the cache busting. While investigating this I actually found an issue with the cache busting. The solution is not super elegant, but at least the caching is working reliably now. I also found out there is an issue with the caching mechanism from netlify using etags : https://answers.netlify.com/t/netlify-ignores-cache-control-for-304/2912/26.

I removed the query param and updated the headers that should be given from netlify for the manifest.json file. This should prevent any issues on older browsers. Anyway older browser are not a very big priority since this PWA stuff is pretty new anyway. Thanks for reporting the ticket 👍