cancel
Showing results for 
Search instead for 
Did you mean: 

sap.fe v4 custom object page sections and caching issues

hschaefer123
Participant

Hi,

while working with custom ObjectPage sections using extension, i ran into caching issues to be able to see my changes inside the browser.

After some investigations (and a nice hint on twitter) i figured out, that the underlying sapui5 cache is the reason for this, because the custom extensions are cached in the browser indexedDB storage.

To get rid of this, i am using the following line inside my Component.js

// disable ui5 cache for reuse components while developing
sap.ui.getCore().getConfiguration().setUI5CacheOn(false);

Is there a better way of controlling this feature while developing?

If not, i will wrap this at least in an if like (location.host === 'localhost') to avoid prod issue without cache.

Best Regards

Holger

View Entire Topic
marcel_waechter
Advisor
Advisor

Hi Holger,
exactly the outcome of the Fiori elements templates (including the custom sections) are cached for better performance.

During development you can just add the following URL parameter: sap-ui-xx-viewCache=false

(see also https://openui5.hana.ondemand.com/topic/91f2d03b6f4d1014b6dd926db0e91070.html)

I hope this helps you.

Best regards,
Marcel Wächter

hschaefer123
Participant
0 Kudos

Hi Marcel,
gotcha. That's what i thaught.

I did not use XML Templates in the past, because they did not support routing (maybe this has changed), but with developing custom controls for sap.fe, i ran into this.

Thanks for the great tip.

Best Regards
Holger

gregorw
Active Contributor
0 Kudos

Hi Marcel,

unfortunately I can't find the parameter sap-ui-xx-viewCache=false easy on the page you've provided. Only when I search with viewCache in the experimental flags it is found. If I google for sap-ui-xx-viewCache=false I land at:

Cache Behavior for Application Resources

which documents the parameter sap-ui-xx-devmode. Which is only documented there. I've tested it but it seems to have no effect.

Can you please clarify?

Best Regards
Gregor

hschaefer123
Participant

Hi Gregor,

luckily in the meantime, the generators put this into the start scripts of the package.json:

"start-local": "fiori run --config ./ui5-local.yaml --open \"test/flpSandbox.html?sap-ui-xx-viewCache=false#project1-tile\"",

but i can also be used it in a localIndex.html file besides additional dev settings

<script id="sap-ui-bootstrap" 
...  data-sap-ui-xx-viewCache="false"

Just to have the full picture, if you land on this site 😉

Regards
Holger