visitscotland / dot-com-brxm

MIT License
0 stars 0 forks source link

(FED) SSR causing CLS issues #282

Closed MichaelGrahamVS closed 11 months ago

MichaelGrahamVS commented 1 year ago

Background

SEO flagged that our CLS score (part of Core Web Vitals) has dropped significantly since we made some changes to our SSR approach.

Summary

Review our SSR approach and determine how we can improve our CLS score.

Desired outcome

Aspect of SSR causing the CLS issue clearly defined with a proposed fix detailed in a follow on ticket.

Timebox

Half a day

mjpvs commented 11 months ago

Hey @CorinaMala

https://feature.visitscotland.com/?vs_brxm_host=172.28.87.25&vs_brxm_port=8004&vs_brxm_http_host=feature.visitscotland.com&vs_ssr_http_port=8204&vs_tln_http_port=8304&vs_feature_branch=PR-334&vs_ssr_proxy=on

I've restored the fix which went missing on this environment. If you run a lighthouse test on there (in the console > lighthouse > analyze page load) hopefully you should now see a cumulative layout shift of 0, or close to 0 (and in the green). When you're loading the page normally outside of the lighthouse test the page should still load normally and all the dropdowns and stuff should still hydrate and work as expected

CorinaMala commented 11 months ago

@mjpvs I've checked most of the content on the feature environment and I can say it is all working as expected and the score is a consistent 0.0011 on Core Web Vitals and a 0 on Lighthouse. As mentioned on our chat, I did notice that score increasing the longer I stayed on the page, however I did see a direct correlation between each increase and the Facebook pop-up message appearing. If I use the component on the pages OTYML, expand etc I do not see the score increase.

As such, ready to be merged to develop