cancel
Showing results for 
Search instead for 
Did you mean: 

SAP-Server sends no-cache, Appcache doesn't work

Former Member
0 Kudos

Hi guys

I'm developing a SAPUI5 application that needs to work offline. I'm using the Eclipse plugin provided by SAP to develop the app and upload it to the ABAP-server (SAP ECC 6.0, Enhancement Package 7).

In Chrome my appcache works fine on all platforms, yet it doesn't work in any other browser. I found out that the server sends "cache-control: no-cache, no-store" for my index.html file.

I tried to set the Browser-Cache to 1 day in the properties of index.html in se80 on the SAP server, but that didn't change anything. I googled a lot but just can't find out how to turn this off. Does anyone know how to turn this off?

Thank you so much.

Accepted Solutions (1)

Accepted Solutions (1)

milicln
Explorer
0 Kudos

Hi Benjamin,

as I mentioned in this comment try to rename the index.html for example in start.html.

Best regards,

Michael

Former Member
0 Kudos

Thank you very much, that could be an easy solution. I'll look into that as soon as our server works again (hdd broken :-D).

Former Member
0 Kudos

Server works again and I tried your solution. Works perfectly, thank you so much!

Answers (2)

Answers (2)

SergioG_TX
Active Contributor
0 Kudos

in the index file, you may try to add this to the head tag:

update the content attribute with whatever you need either no cache or the value you need for offline caching

Former Member
0 Kudos

Did you forget to add some text after the colon? Are you saying, I could add something to the head tag of a normal html file or to a BSP page?

I'd like to keep it an html file because I want to use the same files in different environments.

christian_jianelli
Contributor
0 Kudos

Hi Benjamin,

Change the header field by using the method set_header_field of the response object inside the OnInitialization event of the BSP page or inside the layout of the BSP page.


Example:

response->set_header_field( name = 'Cache-Control' value = 'private, max-age=30879000' ).

Regards,

Christian Jianelli

Former Member
0 Kudos

Thank you very much for your answer. Sine I develop a "normal" HTML5 Application using the SAPUI5 Eclipse plugin I have a normal HTML-Page, not a BSP page. How can I set the headers there? Or do I have to convert my index.html to a BSP page somehow?

christian_jianelli
Contributor
0 Kudos

Yes. To change the response header via coding you will need to convert your static html file to a bsp page.

Regards,

Christian Jianelli