Skip to content

Metadata Cache

To improve response times, the OData Provider stores service metadata in a cache after loading it from the database. By default, this cache is updated every 10 seconds to ensure the data remains current. You can adjust this interval using the system parameter:

OData Provider Projection Cache Refresh Interval (Seconds)

This parameter is accessible via:

Solution Manager → Setup → System Parameters

Frequent refreshes help prevent both BAD_REQUEST and MI_MODIFIED_ERROR errors by reducing the likelihood of projection requests containing outdated information.

To make sure the cache is up-to-date, the OData Provider also validates the cached metadata version against the database version with each request. If a change to the metadata occurs during the refresh interval and a request is sent before the refresh, the validation will fail. In this case, the request will return an HTTP 503 response with the error code MI_MODIFIED_ERROR.

Then OData-Provider will invalidate the cached metadata, forcing it to be fetched from the database at the next request.

Response:

{
  "error": {
    "code": "MI_MODIFIED_ERROR",
    "message": "Cached Service metadata is outdated. Please try again."
  }
}

The Retry-After HTTP Header is also set in the response to notify the client that it can retry the request.

When a user gets this error response the OData-Provider expect the user to retry the same request again. Then OData-Provider will load the latest metadata from the database and serve the request accordingly.