cancel
Showing results for 
Search instead for 
Did you mean: 

Best practises concerning optimizing a custom SAPUI5 app running in SAP BTP

hschaefer123
Participant
1,238

Hi SAP,

trying to optimize and find a caching strategy for a custom SAPUI5 app, that is running in SAP BTP without using a central launchpad and the managed app router, but beeing delivered from HTML5-app-repo is currently quite hard!

Also SAPUI5 SDK is telling, that support is just given on AS ABAP

https://sapui5.hana.ondemand.com/#/topic/ff7aceda0bd24039beb9bca8e882825d

SAPUI5 supports the application cache buster on SAP NetWeaver AS for ABAP only.

@SAP/AppRouter

Using the AppRouter in conjunction with the HTML5 App Repo, you will get a cache mechanism out-of-the-box that does not seems to be documented so far.

This works quite well, till you have to use a custom route instead the auto route comming from the manifest app-id.

In such case, i have to mimik the automatism of the approuter like

{
"source": "^/myUI5Route/index.html(.*)$", "target": "/appidwithoutdots/index.html$1",
"service": "html5-apps-repo-rt",
"cacheControl": "no-cache, no-store, must-revalidate"
}, {
"source": "^/myUI5Route/sap-ui-cachebuster-info.json(.*)$", "target": "/appidwithoutdots/sap-ui-cachebuster-info.json$1",
"service": "html5-apps-repo-rt",
"cacheControl": "no-cache, no-store, must-revalidate"
}, {
"source": "^/myUI5Route/~(.*)~/(.*)$",
"target": "/appidwithoutdots/$2",
"service": "html5-apps-repo-rt"
}, {
"source": "^/myUI5Route/(.*)$",
"target": "/appidwithoutdots/$1",
"service": "html5-apps-repo-rt"
}, SAPUI5 BootstrappingIn this scenario, the following bootstrap seems to work fine for a custom SAPUI5 app.
<script id="sap-ui-bootstrap"
src="https://ui5.sap.com/1.96.8/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-appCacheBuster="./"

But what about the newly introduced evergreen CDN bootstrapping?

https://sapui5.hana.ondemand.com/1.100.1/#/topic/2d3eb2f322ea4a82983c1c62a33ec4ae.html#loio2d3eb2f32...

SAPUI5 Evergreen Bootstrapping

What will be the optimized caching strategy?

Also the docu inside the above link is currently broken, but generally it should be possible to use

<script id="sap-ui-bootstrap"
src="https://ui5.sap.com/1.96/resources/sap-ui-cachebuster/sap-ui-core.js"

the evergreen path (without patch) that should forward to the latest patch release.

I think, also the /sap-ui-cachebuster/ part is needed, to get the latest patch directly
(without it, sap-ui-core.js is deliverded with max-age=31426341)

Talking about Performance, using evergreen i got

https://sapui5.us1.hana.ondemand.com

but should it not return the endpoint next to me like eu?

Also trying to use /sap-ui-cachebuster/ productively leads to errorsap-ui-core.js:15 Failed to execute 'write' on 'Document':
It isn't possible to write into a document from an asynchronously-loaded
external script unless it is explicitly opened.

UI5.yaml
Is there also a hidden option for the tooling to use the latest patch?

framework:

version: 1.96.8 // 1.96 throws error

Question

Maybe i just did not find the corresponding docu to be able to optimize a custom SAPUI5 SaaS app running in SAP BTP and you can point me to it (no Launchpad, no Managed AppRouter, etc.).

Maybe the corresponding section in the SAPUI5 SDK can be updated, because besides ABAP and HANA, there seems to be support for SAP BTP, but currently not documented.

Best Regards

Holger

Accepted Solutions (0)

Answers (0)