Search code examples
odatasapui5

How to disable cache in odata v2 model sapui5


oData v2 model has the feature to cache the used data and read data. I want to disable the cache feature. I don't want to keep the data in my model. Any suggestions?


Solution

  • You cannot disable cache. But you also don't really need to.

    If you're afraid that the cached data is old, just use the refresh method to get the model to retrieve new data from the server. When you execute the refresh method, each binding reloads its data from the server. For list or element bindings, a new request to the backend is triggered.