cancel
Showing results for 
Search instead for 
Did you mean: 

Application Cache Buster in HCP

ParagJain
Participant
0 Kudos

As described in this help link - Application Cache Buster - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library - App Cache Buster is also supported on HCP.

We have the following code which works well when deployed on Prem.

<script

id="sap-ui-bootstrap"

src="resources/sap-ui-core.js"

data-sap-ui-xx-bindingSyntax="complex"

data-sap-ui-libs="sap.m,sap.ui.comp,sap.ui.core"

data-sap-ui-theme="sap_bluecrystal"

data-sap-ui-resourceroots='{

    "com.x.y": "./",

    "webapp": "./webapp"}'

data-sap-ui-appCacheBuster="./">

</script>

When we deploy the same code on HCP, get the following error:

  1. Request URL:https://webapp-<hcpaccount>.dispatcher.hana.ondemand.com/sap-ui-cachebuster-info.json?sap-ui-language=en-US
  2. Request Method:GET
  3. Status Code:404 Not Found

Observation:

URL formation for on-prem:

https://fqdn:port/sap/bc/ui5_ui5/sap/webapp/sap-ui-cachebuster-info.json?sap-ui-language=en_US

URL formation for HCP:

https://webapp-<hcpaccount>.dispatcher.hana.ondemand.com/sap-ui-cachebuster-info.json?sap-ui-language=en-US

Query:

Has anybody tried this out before and do we know of any solution ?

Regards,

Parag.

Accepted Solutions (1)

Accepted Solutions (1)

ParagJain
Participant
0 Kudos

Had raise this issue via SMP and got the following reply:

the AppCacheBuster is not supported for HCP HTML5 applications out-of-the-box. The documentation is unfortunately misleading since it doesn't reflect the new HTML5 apps there and is based on the state for the  Java applications:


For UI5 applications running on Java as well as for UI5 applications running on ABAP this file is generated automatically.

You should either remove the option data-sap-ui-appCacheBuster="./" on the bootstrap script which disables the application cachebuster or you create this file manually - but for

that scenario you have to take care that you handle the timestamps for the resources properly.


Regarding the HTML5 apps roadmap - till now it is not planned to support it.

Answers (1)

Answers (1)

0 Kudos

Hi Parag,

Warm Greetings. In HCP, this can be done by using Application Descriptor File (neo-app.json). Kindly refer the below links that has more detailed info.

https://help.hana.ondemand.com/help/aed1ffa3f3e741b3a4573c9e475aa2a4.html

https://help.hana.ondemand.com/help/frameset.htm?1814d3603acd4ab18102a3b4984687b4.html

Regards,

Ajay

ParagJain
Participant
0 Kudos

Hello Ajay,

The link you have shared is for cache control; specifically for static resources with a "age". My query is on cache buster - clearing the cache / reloading when there is a new resource.

Application cache buster primarily allows you to cache the application resource files in the browser till a new file is uploaded on the server. This is determined by comparing the time-stamps and handled by the framework.  

Regards,

Parag.

0 Kudos

Hello Parag,

I am using a HTML5 Application on my HANA Trial and here application cachebuster works with out any issues. I usre routing to access my UI5 resources and route in my app. descriptor is as follows:

{

      "path": "/resources",

      "target": {

        "type": "service",

        "name": "sapui5",

        "entryPath": "/resources"

      },

      "description": "SAPUI5 Resources"

    }

My welcome file is index.html and here is the bootstrapping part:

<script id="sap-ui-bootstrap"

src="resources/sap-ui-cachebuster/sap-ui-core.js"

data-sap-ui-libs="sap.m"

data-sap-ui-theme="sap_bluecrystal"

data-sap-ui-appCacheBuster="./"

data-sap-ui-xx-bindingSyntax="complex"

data-sap-ui-resourceroots='{"<namespace>": "./"}'>

</script>

Below are the screens which shows the same. Please give a try.

Regards,

Ajay

ParagJain
Participant
0 Kudos

Very strage, have similar settings for neo.app and script tag.

"routes": [

                  {

      "path": "/resources",

      "target": {

        "type": "service",

        "name": "sapui5",

        "entryPath": "/resources"

    },

      "description": "SAPUI5 Resources"

      },


<script id="sap-ui-bootstrap"

src="resources/sap-ui-cachebuster/sap-ui-core.js"

data-sap-ui-xx-bindingSyntax="complex"

data-sap-ui-libs="sap.m,sap.ui.comp,sap.ui.core"

data-sap-ui-theme="sap_bluecrystal"

data-sap-ui-appCacheBuster="./"

            data-sap-ui-resourceroots='{

"<NAMESPACE>": "./",

"view": "./view"}'

            data-sap-ui-language="en">

  </script>

For us as well the first 2 URLs are working well.

https://XXXX.dispatcher.hana.ondemand.com/resources/sap-ui-cachebuster/sap-ui-core.js

https://XXXX.dispatcher.hana.ondemand.com/resources/~19c1858f4eca55965a1d48c33aff85910b2eb3eb~/sap-u...

Its only the 3rd URL of the cache buster json which returns a 404.

https://XXXX.dispatcher.hana.ondemand.com/sap-ui-cachebuster-info.json?sap-ui-language=en

Is there a setting in HCP cockpit that we are missing ? Tried it in developer account as well as trial account with same result.