interface icon indicating copy to clipboard operation
interface copied to clipboard

UI file versioning so that users don't have to hard refresh to get the latest UI

Open helpfulBro opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Users should not need to refresh to get the latest version of the UI, it should happen automatically.

Describe the solution you'd like Include a unique ver?=param like a unix timestamp to scripts so the browser does not use the cache if there is a newer file.

It's simple and effective, here is an explanation : https://sebhastian.com/javascript-versioning/

Ideally users shouldn't have to hard refresh to get the latest version if possible.

Describe alternatives you've considered An update button similar to 1inch if versioning is not possible on IPFS hosting?

image

Additional context None

helpfulBro avatar Apr 26 '22 08:04 helpfulBro

It's not the issue you think it is. The files are in fact versioned. image

The issue here is not easily solvable as the app is hosted on ipfs and app.aave.com is just a CNAME to a public ipfs gateway (1inch in comparison is a centralized interface giving them a bit more flexibility). The gateway is in control over the cache headers and it seems like they are set to max-age=86400 (1 day) so as the index.html is cached on the client it will be stuck on the old version for 24h before a new index.html is loaded which will in turn request the new version.

There might be a way to work around this by setting a lower dns ttl @RoRu?

sakulstra avatar Apr 27 '22 10:04 sakulstra

Ahh okay that makes sense.

However in the past we've had users that have needed to hard refresh due to still being on an old cached version even though the latest deployment was more than a day ago.

Would it be possible that even after the user is directed to the updated IPFS deployment that the browser still uses the locally cached index.html?

helpfulBro avatar Apr 27 '22 23:04 helpfulBro

@RoRu Is this something that can be solved by switching gateway provider?

defispartan avatar Jul 27 '22 21:07 defispartan

While perhaps on another gateway you might have a bit more control in the end users are accessing the app via arbitrary gateways.

I think a good way around this would e.g. be to add a version artifact which you could periodically ping - so you can ask the user to reload once it's outdated. A bit like OTA updates work.

sakulstra avatar Jul 27 '22 21:07 sakulstra