0

We have observed that an adapter request's response is getting cached within the app in a cache.db file.

Is there a way to avoid this? is there any configuration in worklight property file?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
vishal_g
  • 3,871
  • 4
  • 21
  • 34

1 Answers1

0

There is the following IBM Worklight technote: http://www-01.ibm.com/support/docview.wss?uid=swg1PM95421

Sensitive data, such as usernames and passwords that are part of URLs, is being stored in the iOS cache.db file in plain text.

This issue can be worked around by using calls to WL.Client.addGlobalHeader('Cache-Control', 'no-store, no-cache'); at the appropriate places in the app code. A call to removeGlobalHeader() can be used to reverse the Cache-Control setting.

So:

  1. You can try the above.
  2. Also see my questions in the comments section of the question

In addition: there is a way to clear or manipulate this file via native code.
In the context of a Worklight application under the above assumption, you will need to create a Cordova plug-in that will do operations on this file.

See the following:

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • can you please let me know where exactly to add `WL.Client.addGlobalHeader('Cache-Control', 'no-store, no-cache'); ` in the code so that i can remove cache. – vishal_g Apr 28 '14 at 13:00
  • You can add it anywhere in the code. For example, before the adapter request. Please consult with the Worklight 6.1 user documentation. – Idan Adar Apr 28 '14 at 13:07
  • About cache.db or about WL.Client.addGlobalHeader? – Idan Adar Apr 30 '14 at 04:56
  • what is there in worklight docs related to this....and where can i found the docs for the same. – vishal_g Apr 30 '14 at 05:30
  • But what are you asking about?! cache.db, or WL.Client?? There is nothing I can find about cache.db; Search the user documentation for WL.Client and you'll find the docs for that API. Google. – Idan Adar Apr 30 '14 at 05:32
  • Hi Idan , How to clear cache for CFURL, also let me know how to get final request sent to Worklight adapter ? – Abhi Mar 18 '16 at 07:29