on 02-11-2020 4:25 AM
With reference to the above discussion i have done the cache buster in the MII UI5 application.
Application specs:
JSON and xml files which loads with version
JS files which loads without versioning
index.html
//$.ajaxSetup({ data: { _TheAppVersion: data._TheAppVersion }});
(function() {
var proxied = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function() {
var url = arguments[1];
if(url.indexOf("?") == -1){ url = url + "?"; }
arguments[1] = url + "&_TheAppVersion=" + data._TheAppVersion;
return proxied.apply(this, [].slice.call(arguments));
};
})();
Overriding XMLHttpRequest.open() like this seems to work but I don't know if it is a good practice to do this. I suppose with this method if you got into parsing the url you could probably avoid having to reload the ui5 libs when your app version changes wich would be nice.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This seems to be working fine , since we are just appending the versions to the file names, there is nothing related to good practice i feel. because when we do a clear cache and hard refresh in the browser, it takes much more time than this.
So, i feel this is a better solution and we can use it in any versions irrespective of the loaders that varies from version to version.
I too was thinking of doing similar solution but i wasn't aware from where to pick these files and append the versions. From this i got the answer for that as-well.
Thanks a lot for your quicker and the productive solution that's been provided. 🙂
Bhanu,
I do not have access to check at the moment but I see that you configured ui5 to use the app cache buster and I suspect this might be causing your issue. The cache buster isn't supported on netweaver. I think the cache buster uses its own scope/mechanism for loading resourced and because there is no service on the netweaver side to tell it that the files are updated it doesn't appending anything to the urls to try to get the new versions. In your screenshots you can see how the ones being grabbed with the _AppVer... are grabbed by jquery... and the ones without are grabbed by ui5loader...
Anyway just a guess but give it try without the cache buster configured in the ui5 bootstrap.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried removing the cache buster as well, but i am facing the same issue. Even when the cache buster is removed the js files are being loaded by the ui5loader and the js files are not being grabbed with the _Appversion. please help here. Thanks in advance
christian.libich5
I found where is the problem, when i use the versions below 1.56 like 1.52, 1.50's the js files are being loaded by jquery in some versions and sap.ui.core in some versions. In those versions the js files are getting grabbed with the _Appversion.
But when i use 1.56 and above the js files is being loaded by ui5loader, where the js files is not getting grabbed with the _Appversion.
In my application am using 1.60, with which the ui5loader works and the issue comes.
Is there any solution that you can suggest for this.
Looks like at a certain version they changed the way they are loading certain modules, probably as part of removing jQuery dependancies. I don't have a solution at the moment and would recommend putting in a ticket with SAP and see if they have any suggestions. You may want to find an openui5 community and see if they have any solutions. Or try to dig into the ui5 code and see if you can sort it out for all of us 🙂
Regards,
Christian
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.