Hi Team,
I've got a performance problem to tackle in AEM as a Cloud Service based project.
Our setup consists of an headless SPA - a next js web application and a mobile app rely on page model APIs and content fragment APIs (Jackson JSON exporter) to render content. Some of these json payloads can go upto 9mb's and this causes noticeable slow page load times. Can you suggest options to compress the json responses ?
I've looked at adding a sling filter as described here but it doesn't seem to be affecting anything.
Where can I add custom code to compress the response before it goes to the client ?
Thanks.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
You could compress the response at the Dispatcher layer. Check this link for more information: Enable Text Compression in AEM.
But ideally, you should break down that huge response. If you are using GraphQL to export the Content Fragments, you could add pagination and ensure the query is optimal. Please refer to this link for details: GraphQL API for Content Fragments - Paging. Regarding Sling Models, make sure you are exposing only the necessary information and not extra information such as JCR properties.
Hope this helps.
Hi,
You could compress the response at the Dispatcher layer. Check this link for more information: Enable Text Compression in AEM.
But ideally, you should break down that huge response. If you are using GraphQL to export the Content Fragments, you could add pagination and ensure the query is optimal. Please refer to this link for details: GraphQL API for Content Fragments - Paging. Regarding Sling Models, make sure you are exposing only the necessary information and not extra information such as JCR properties.
Hope this helps.
We have trimmed down the information to the bare minimum.
Thanks for your suggestion on tackling this from the dispatcher layer. I'll check it out.
The fact, that the JSON file is 9MB in size has 2 implications:
I recommend you to test the performance of your application on a device, which is on the lower end of the devices your audience is using (for example a 2 year old smartphone, which was a mid-to-low end range of the devices sold in 2022).
My gut feeling is, that the rendering time of the initial view of this site is quite high; and depending on the site this will reduce already the number of visitors.
Views
Likes
Replies
Views
Likes
Replies