Remote Includes
Please use Remote Includes wisely, especially in combination with caching. Too many cache misses from Remote Includes will negatively affect the system performance. Currently, using more than 50 includes per request triggers a warning. In the future, this limit will be strictly enforced, causing errors. Stay within the threshold to avoid issues. Also, be aware that authentication and authorization are only performed for the main request, but not for the include requests.
- The
RestResponseMgr
methodcreateScapiRemoteInclude()
allows only SCAPI URLs. - The
RestResponseMgr
methodcreateStorefrontControllerRemoteInclude()
allows only Controller URLs.
With B2C Commerce 24.2, you can build your own SCAPI responses and include responses from other sources, such as SCAPI System APIs or other Custom APIs, using Custom API Remote Includes.
Example: We create an API endpoint named includeTest1
. A second API endpoint, remoteInclude
, obtains the response from the includeTest1
endpoint and adds it to the includeArray
array as includeArrayItem1
.
You can add multiple remote includes in the array and create complex and powerful responses.
- The
RestResponseMgr
methodcreateScapiRemoteInclude()
allows only SCAPI URLs. - The
RestResponseMgr
methodcreateStorefrontControllerRemoteInclude()
allows only Controller URLs.
Cross-API requests (for example, including a Controller response within a Custom API or SCAPI hook) are not possible.
For additional information and examples, see RemoteInclude and Passing Data Between Hooks.