SAP Fiori for SAP S/4HANA – Performance: What is CDN?
UPDATE – Relevant for S/4HANA 2021, 2020, 1909, 1809, 1709, 1610 – This feature will be deprecated.
If you have been dealing with Fiori Performance issues, you may have heard something about CDN and want to try it out. If this is the case, please keep reading.
Let’s start by answering the main question of this blog: What the #@¢% is CDN?
The acronym CDN stands for Content Delivery Network and it can be defined as:
“… a globally distributed network of proxy servers deployed in multiple data centers. The goal of a CDN is to serve content to end-users with high availability and high performance. CDNs serve a large fraction of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on-demand streaming media, and social networks.”
Content Delivery Network. Retrieved from: https://en.wikipedia.org/wiki/Content_delivery_network
Second question you may be thinking of is: Why do I need a CDN for SAP Fiori?
Now we know that CDN is a globally distributed network and it will help end users load UI5 libraries from a server closest to their geographical location offering high availability and performance. This leads to the third question: How can I setup CDN in Fiori?
Simple answer, you just need to set it up.
Now that the concept is clear, let’s go through the configuration options. Let’s start by identifying the technical prerrequisites:
- SAP_UI 751 SP01 (equivalent: SAP_UI 740 SP17, SAP_UI 750 SP06) or higher.
- End user devices have internet access.
Overall, two steps are needed to configure CDN:
- Create PFCG Role and Fiori Catalog ZUI5_CDN, which will enable/disable Content Delivery Network.
- Fiori Catalog will be based on Target Mapping configurations, semantic object “Shell”, action “bootConfig”
**Note: You can copy catalog “/UI2/CONFIG/UI5/CDN” to your custom Fiori Catalog.
This time we will skip the steps for creating a PFCG Role and Fiori Catalogs so we can focus on explaining the Target Mapping parametrization, which basically requires you to setup two parameters:
|/ui5/cdn/enabled||The parameter value can be set to “true” or “false” depending whether you want to enable or disable CDN. Setting the value to “true”, allows ABAP Method /UI2/CL_FLP_HTTP_HANDLER~CREATE_CDN_JSON to dynamically switch requests to the CDN url.|
Setting this parameter requires you to specify the url of the CDN and version of the UI5 libraries you wish to implement. Use the syntax https://<customer provided CDN>/<version>/resources , where version stands for the UI5 library version, for example, 1.44.10
The use of this parameter is intended only for testing purposes, we strongly recommend not using this parameter in productive environments
When you are done with the settings, your Target Mapping should look similar to:
Once this is done, assign the PFCG Role to your end-users. If you wish to test if the feature is working you just need to use your friendly browser developer tools like in the following examples:
Fourth question you may be thinking of is: Can I use SAP’s CDN for my on-premise SAP Fiori implementation?
“The usage of the SAPUI5 CDN is only allowed for SAP Cloud products like e.g. SAP Cloud Platform, SAP S/4HANA Cloud, SAP SuccessFactors or SAP HANA Enterprise Cloud, however on premise installations/systems are not allowed to bootstrap SAPUI5 from the SAPUI5 CDN. This also applies for SAP Fiori/SAPUI5 applications which were built by customers and partners. When running on SAP Cloud Platform, the usage of the SAPUI5 CDN is included, also for the development phase with e.g. SAP Web IDE or SAP Business Application Studio.
However, when being deployed to an on premise system, the SAP Fiori/SAPUI5 applications must not consume SAPUI5 from SAP’s CDN.”
Fifth question is: What can I do if I really want to use CDN in my on-premise SAP Fiori Implementation?
The solution is to configure an own CDN based on a contract with the CDN provider of your choice.
**Note – If you wish to learn how to implement your own CDN provider, you can go through this excellent blog by Mario de Felipe: How to improve the performance of SAPUI5 Apps such as Fiori using Amazon CloudFront as CDN
Sixth question is: I’ve been using SAP’s CDN for some time now. Can I continue to use it?
Unfortunately, loading SAPUI5 from a Content Delivery Network (CDN) using a target mapping is now deprecated. The function will be removed in a future version (target: ABAP Platform 2021).
You can find more details in the following: link
If you have used the target mapping option described in this blog, you need to switch now. We recommend using SAPUI5 boostrapping instead.
Becoming a SAP Fiori for SAP S/4HANA guru
You’ll find much more on our SAP Fiori for SAP S/4HANA wiki
Do you have any questions? Let us know in the comments section.
SAP S/4HANA RIG