Enabling performance logging for Viewport
In Scroll Viewport you are able to track in detail the performance on how long a page needs to load in Scroll Viewport.
This is especially helpful if your Viewport loads slowly and you need to identify the reason. This could be a macro on the page or the code of the theme or anything else.
How to enable Performance Logging for a Viewport
To track down the performance of a viewport site you can do the following:
Within your Advanced Scroll App Settings set the
allowPerformanceLogging
to true.Do the request either via:
Request Header
On your request send an additional header:X-Scroll-Viewport-Enable-Performance-Statistics = true
Query Parameter (Scroll Viewport 2.17.6 and later)
Append the URL query parameterX-Scroll-Viewport-Enable-Performance-Statistics=true
to individual requests.
The query parameter approach can also be applied to REST calls to the/rest/scroll-viewport/latest/tree/children
resource.
(Optional) Turn on
DEBUG
logging for the packagecom.k15t.scroll.viewport.infra.performance
viaGeneral Configuration > Profiling and Logging
to get the same trace in the server logs. This is a prerequisite for analysing any URLs that don't return HTML.If the advanced plugin setting is enabled and either the header or the query parameter are given, you can call the Viewport URL that you want to analyse.
The performance logging will then be visible in the HTML of the page you called and (if step 3 was done) in the server logs.
On inspecting the HTML with the Browser Developer Tools you can see a comment within the HTML (before the closing body tag) on the bottom of the page.
Please make sure to append the query parameter with a '?' question mark to the URL if there are no other query parameters present and with a '&' if the URL already has query parameters.
Your Url should look something like this:
https://www.example.com/space/page-123.html?X-Scroll-Viewport-Enable-Performance-Statistics=true
https://www.example.com/space/page-123.html?parameter=true&X-Scroll-Viewport-Enable-Performance-Statistics=true
Example output of a performance log: