First Contentful Paint or FCP is one of the important metrics in UI Performance Testing. It provides the time when the browser renders the first bit of content like text, image, non-white canvas etc. It gives the first impression to the user that the page is actually loading.
Behind the concept of FCP, there is another term called ‘First Paint‘ that we have already discussed in the previous article. In the browser, the First Paint occurs when any render is detected like a change in the background colour. Please note that such changes are purely uninformative and subtle; definitely difficult to analyse. Hence FCP is more important than FP.
Let’s try to understand First Paint, First Contentful Paint and Largest Contentful Paint (LCP) with an example. Kindly park LCP as of now because this is another big topic of discussion. Refer to the below figure:
Which is useful- First Paint or First Contentful Paint?
- First Contentful Paint time is more representative from user’s experience perspective because it provides the timing when the actual content has been loaded in the page and not just any change.
- First Paint changes are subtle and do not give proper impression to the end user for any page loading action whereas user consumable information like text, images etc. are started loading when First Contentful Paint is started.
- For a faster and lighter website, both the timing could be same. So, it is better to consider First Contentful Paint metric over First Paint metric.
- For a complex website, there may be a considerable difference between both the timings. First Contentful Paint is more useful for user experience assessment than just considering when a background has been changed or a style has been applied.
What should be the ideal value of FCP?
As per the Google Lighthouse document:
|FCP Value (in seconds)||Website Speed||Google Lighthouse Color-Coding|
|0 to 1.8||Fast||GREEN|
|1.8 to 3||Moderate||ORANGE|
How to improve FCP?
Following are some suggestions to improve the FCP:
- Improve font load time
@font-facestyle to display the system font when text is available and then browser replaces the system font once custom font is ready.
- Use preload tag to fetch the font files first. The tag is
<link rel="preload" as="font">
You may be interested: