Experimenting with basic HTML to analyze the impact of cookie consent code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="determine page load speed">
<title>Page Speed Test 1</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href="favicon.png" rel="shortcut icon" type="image/x-icon">
<!-- BEGIN Cookie Consent -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#eee",
"text": "#000"
},
"button": {
"background": "#0f0",
"text": "#ffffff"
}
}
})});
</script>
<!-- END Cookie Consent -->
</head>
<body class="body">
<h1>Greetings!</h1>
<p>
Just a test.
</p>
</body>
</html>
FCP without Cookie Consent: 0.8s (according to Google's PageSpeed Insights).
FCP with Cookie Consent: 1.9s. Significant performance decrease!
What can be done to improve FCP to around 1 second?