Serverside rendering of parts

Enonic version: 6.15.6
OS: Windows

Hi, I have recently set up some parts which make use of http-lib to make requests to cloud solutions. In this regard I was wondering how this would hit me performance wise. I am aware that all the parts needs to complete before the page is rendered.

Are the parts rendered sequentially or async on the server side?

Best,

Tom

Hi Tom,

Part controllers are typically rendered sync, so any http-requests will delay rendering. I would advice you to cache the requests, using our lib-cache. You could do async using lib-task, with it you create tasks that are running on the server independant of current request, returning its answer when completed.

Cache: https://developer.enonic.com/docs/cache-library/master
Tasks: https://developer.enonic.com/docs/xp/stable/api/lib-task

Thanks! I’ll have a look