Skip to Content

Offline-App with SMP: Disable "modified-since" for metadata-requests?

Feb 21 at 09:52 AM


avatar image

Hello together,

I have a kapsel-offline-application using a sap-mobile-plattform-server as middleware (and nw-gateway as odata-provider.)

In the middleware I configured a second backend-connection that i Use from the client for some online-requests beside the kapsel/offline handling.

That works fine, until I close and restart my app. When I then instantiate the online-model (ODataModelV2) I dont get the metadata.

I see that the smp sends an "modified-since-header" with the $metadata-Request. I know thats used for performance improvements.

Does somebody know a possibility to avoid this header? Maybe some parameter in the smp?

10 |10000 characters needed characters left characters exceeded

Hello to confirm and better understand your issue, you are talking about 2 connections.
One is Offline and the other is Online and you are seeing this issue specifically on the Online connection.
And on the Online Connection, you are doing Conditional GET Requests?
Please let us know


Hello Bob,

I have defined 2 connections for an application in the smp.

Both accesing the same gateway-url and service.

One connection is used for the offline-functionality (kapsel-odata and -offline plugins).

The second-connection with the ".online"-suffix is used to instantiate an second-odatamodel for online-requests.

var oModel = new ODataModel(sServiceRoot, {
   headers: Devapp.getAuthHeader(),
   json: true,
   bTokenHandling: true,
   useBatch: true,
   defaultBindingMode: sap.ui.model.BindingMode.OneWay,
   defaultCountMode: sap.ui.model.odata.CountMode.Request
oModel.attachMetadataLoaded(function() {
   this.setModel(oModel, "online");
oModel.attachMetadataFailed(function(oError) {
   this.logTrace("Failed to lead online metadata.", fnReject);

My problem is, that the smp then sends these conditional-requests for retrieving the metadata. I dont do any explizit request.

I assume, that the smp do this, because it also have the metadata retrieved from the other connection. And so this model cant be instantiated.


Thank you for the added details.
It does not seem to be an Offline OData question or issue.
The Online SDK does some ‘offline’ caching, and apparently, there’s some issue, either with this code or with the use of it.
We are still in the process of researching.


You mention:
<<I see that the smp sends an "modified-since-header" with the $metadata-Request. I know that’s used for performance improvements.
We would suggest seeing what was modified since header is coming from the OData service rather than the SMP server.
I assume you would be able to make the metadata request in your chrome browser and examine the headers in the networking tab of the Web Inspector.



thats the response if I retrieve the metadata directly from the Gateway-Client:

When I do this in Chrome, I'll get the same response. Everything is fine.

But when I now instantiate an ODataModel in my app, the following is send to the gateway. (I've captured this with a trace).

And I dont get a response.

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

0 Answers