Closed anojperera closed 2 years ago
Current lighthouse scores are as follows:
Landing page:
Cookies page:
Climate and weather dashboard:
The UK's climate is changing article:
Articles landing page:
As an indicator of the performance levels that should be achievable with Volto the following EEA page achieves good Lighthouse scores:
https://www.eea.europa.eu/ims/drought-impact-on-ecosystems-in-europe
As a guide the network requests and content sizes for the above example are:
The network requests for the article The UK's climate is changing article are shown below:
Notable in the waterfall trace is that a significant amount of the overall time is spent waiting for a response from the server (the traces in green on the right).
Looking in more detail at the first request we can see that the time spent waiting for server response was 985ms whereas the time spent on content download was 26.5ms. This is a ratio of over 1000:1 of server response time to content download time.
For this particular request an element of server response time may be explained by server side rendering processing, but this is less likely to be the case for some of the other long waits for the server further down the waterfall trace.
A second factor in the overall time spent fetching resources is time spent while the connection for a request is stalled.
This is indicated in grey in a number of requests towards the bottom of the waterfall trace below (also for the article The UK's climate is changing).
As the browser can open up a maximum of 6 TCP connections at a time then these later requests are stalled until a connection becomes available.
A page with a large number of requests exacerbates the issue with long server waits described in the comments above.
Following on from the observation above that more requests raises the likelihood of requests being stalled until a TCP connection becomes available we then looked into what the sources of multiple requests.
One known issue is the double requests for each figure block item which is addressed in issue #612
Setting the duplicate calls aside, there are still a significant number of requests for figure block content in pages which have multiple figures embedded in them. Each piece of embedded content (in this case the figures) require an API call to be made to request that content.
We carried out a simple experiment whereby we created charts inline within a page and compared to a similar sized dashboard page (Climate and Weather) from the CC v2 portal which has embedded figure blocks for each chart.
The inline charts page made a single, slightly larger request to get the whole content of the page, including all of the charts), whereas the embedded figures dashboard page made one request for each figure.
Based on the above analysis we (@anojperera, @mikeAdamss, @eldeal, @StRhys and @charlesons) have discussed a plan of action to improve and optimise the site rendering:
Our goal is to meet performance set out in Google PageSpeed of max server response time 200ms and max page load time 1800ms
Spike to understand how we can enhance loading and rendering of content in the CMS