Just an update to this topic while I am diagnosing it.
There seems to be a problem with Javascript location.reload(true)
which in some cases loads a cached version of the document, which explains why you would see wrong version number in the response. I'm not quite sure what circumstances causes this, but it's actually quite difficult to bypass. See this post:
stackoverflow.com/questions/2099201/javascript-hard-refresh-of-current-page
I have now added the following, hoping it will force browser to reload non-cached version of the document:
location.href = location.href.split('#')[0] + (location.href.indexOf('?') > 0 ? '&' : '?') + 'version=' + new_version;
@Dans34 If you read this, please let me know next time you update if it works! 🙏