on 2019 Oct 01 9:35 AM
Hi all,
I am currently developing an application that is used by multiple people, it includes multi-components from other projects that I have developed. When I make a change and deploy it to the ABAP repository, the changes do not take place unless I manually reset the cache in the browser. This is a problem as I don't want the users to reset their cache every time an update takes place throughout it's application life-cycle.
The main project does reset it's cache however the multi-components inside of the project do not reset cache every time the application is refreshed. I have provided code below for both the main project and one of the multi-components.
I have changed the SRC to '/resources/sap-ui-cachebuster/sap-ui-core.js' and 'resources/sap-ui-core.js'
however it is giving me a 'component cannot be instantiated' error
MAIN PROJECT - index.html
<script id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/1.62.0/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"mainproject.mainproject": "./"}'
data-sap-ui-appCacheBuster="./"
data-sap-ui-language="en"
</script>
MULTI-COMPONENT - index.html
<script id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/1.62.0/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-async="true"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatVersion="edge"
data-sap-ui-appCacheBuster="./"
data-sap-ui-resourceroots='{"custLookup.custLookup": "./"}'>
</script>
Thank you in advance!
Sunil.
Request clarification before answering.
Hi Sunil rajshakha,
Now I've some idea about ur issue. First thing is, If you use the registerModulePath then you have the issue with cachebuster. you need to explicitly set it for all the components, i did that 3 years back, not sure if something got changed now.
sap.ui.core.AppCacheBuster.register("/sap/bc/ui5_ui5/sap/ZAPPNAME/");
That is how I was able to clear cache of my loaded components back then.
Now coming to your script, it will never get execute. Because Launchpad loads only the component not the index.html and you are only cachebusting for the UI5 resources. (am I missing something here).
Now again about the best practice. you don't need to load the component using register module path. You can directly mention in the ui5 manifest.json like below.
https://ui5.sap.com/#/topic/fb19f501b16e4e4991eb6a017770945b.html
Using this is the best approach as it will take care of cache as well. I wrote an another blog which talks about component reuse but not sure if you have that if your version of ui5 (you need to check the 2nd part).
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you are doing properly, you don't need
jQuery.sap.registerModulePath("custLookup.custLookup", "LOCATION OF WHERE THE MULTICOMPONENT IS STORED IN THE REPOSTIORY");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
8 | |
7 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.