Skip to Content
Jul 29, 2020 at 05:52 PM

Performance issue csn.json / OData metadata in CAP application


We have a huge data model that we want to expose via CAP and Fiori Elements. This data model consists of appr. 1.500 entities.

In a first prototype we created about 300-400 entities. Cause a lot of the entities are connected to each other via associations and aggregations in this first approach we exposed all entities via one CAP service.
This approach is extremly slow. For the first request the user has to wait about 3 minutes. ~2.5 minutes till the first byte (TTFB = Time To First Byte) of the OData metadata request arrives at the client. The rest is needed by SAPUI5 / Fiori Elements to parse the metadata file and render the UI.

We then created another "performance testing prototype". Because one of the main interest entities with all it's connected entites is huge this sums up to appr. 130 entities which is still a huge model. As a result this application still needs 1.5 minutes for TTFB.
The csn.json has a size of 7.0 MB. The OData metadata file that is generated and transmitted to the client is appr. 4.3 MB in size.

Cause 1.5 minutes for TTFB is still to much in a productive environment we separated the one big CAP / OData service into several ones. After all optimizations which are possible at design time we have a resulting csn.json size of ~2.5 to 4 MB and a OData metadata size of ~350 to 800 kB for the several services.
This leads to the following response times:
TTFB: 6 - 15 seconds

This sounds great but is still to much for a productive application.

So my question is: Is there a way to deploy preprocessed OData metadata files to the server (XSA) or can we preprocess the csn.json file(s) after deployment of our MTAR file so that the server just has to deliver these preprocessed files?

Thanks in advance