cancel
Showing results for 
Search instead for 
Did you mean: 

Cache buster in CAP application

davidgbarbero
Participant
0 Kudos

Hello all!

We are developing an application using SAP CAP and we have 3 different projects: one for the data model, one for the application frontend and one for the application router (standalone app router). All of them are deployed in BTP Cloud Foundry and can be accessed through the app router url.

We sometimes, when deploying new changes, need to refresh cache from the browser developer tools in order to see the new changes. We have implemented the cachebuster in the application frontend as stated in the documentation. We do not have/use the Portal-Build Worzone service.

What is the correct way to handle cache busting in these cases? Is there anything needed to be done in the application router xs-app.json file? I have read it should be handled automatically... but it does not.

The route we have for the application repository is the following:

 

    {
      "source": "^(.*)$",
      "target": "/$1",
      "service": "html5-apps-repo-rt",
      "authenticationType": "xsuaa",
      "scope":"blabla",
      "csrfProtection": true
    }

 

Any advice given will be much appreciated.

Thanks in advance.

View Entire Topic
WouterLemaire
Active Contributor

Hi, Cachebuster depends on the system where you run your application, eg fiori Launchpad has a cache buster indexing report to make sure the end users see the latest version. The same concept is also in workzone. 

For standalone apps you can try to configure the xs-app.json like in this example:

https://github.com/gregorwolf/HTML5UserAPIforCF/blob/f8676f105d0cf068be1a0d53b6522463cdbbedd9/HTML5M...

not sure if this will work for all scenarios, another way could be the following:

https://community.sap.com/t5/technology-blogs-by-members/cache-buster-indexing-ui5-tooling-task/ba-p...