Skip to Content
1

How to stop caching of Controller.js file in SAP WEB IDE using neo-app.json file ?

Mar 20 at 09:11 PM

130

avatar image

Hi,
I am trying not to cache all files inside my controller folder . My sap WEB IDE application has structure like applicationname/webapp/controller/other.js file .
When I debug using Chrome developer tool I can see all controller file are cached under "public" folder for 31536000 seconds. I get this info inside sap-ui-cachebuster-info.json .
I also tried to create

I added code for not caching controller file like this in neo-app.json file.

"cacheControl": [
    {
      "directive": "private",
      "maxAge": 0,
      "path": "**.html"
    },
    {
      "directive": "private",
      "maxAge": 0,
      "path": "webapp/controller/gpl.controller.js"
    },
    {
      "directive": "private",
      "maxAge": 0,
      "path": "sap-ui-cachebuster-info.json"
    },
    {
      "directive": "public",
      "maxAge": 31536000
    }

Even after adding controller in the with with "maxAge": 0 .It is caching the controller file.

How to solve this problem.when I change my code in controller .The users of application get old code .my requirement is to have latest updated code in js file.

I even try to this by adding solve by adding sap-ui-cachebuster/ in index.hml file but it is not working .

index.html file code

<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-compatVersion="edge"
data-sap-ui-preload="async"
data-sap-ui-resourceroots='{"test.poc.app": ""}'>
</script>
How to allow SAP Web IDE SAPUI5 application to request file from server if there is any change in code otherwise cache the application files.

used below link for reference

Thanks,

Abul

10 |10000 characters needed characters left characters exceeded

Hi Abul,

I am experiencing same behavior with an application.

Is the issue resolved? Thanks,

-Regards/ Sai

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

David Freidlin
Oct 16 at 05:59 AM
0

Hi Abul,

In case you would like to not cache your application files, you can use "?sap-ui-debug=true" URL query.

Thanks,

David

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi David,

Thank you for the reply .
As a developer I can pass query parameter and do but I can not say to every person who is testing my application .

Regards,
Abul

0