JS Performance & size optimization (cookiesjsr)

Created on 4 December 2022, about 2 years ago
Updated 6 September 2024, 4 months ago

Problem/Motivation

https://www.webpagetest.org for example reports:

1.

Largest Contentful Paint is high (over 2.5s).

The HTML driving your LCP is <span class="cookiesjsr-banner--text">We use a selection of our own and third-party cookies on the pages of this website: Essential cookies, which are required in order to use the website; functional cookies, which provide better easy of use when using the website; performance cookies, which we use to generate aggregated data on website use and statistics; and marketing cookies, which are used to display relevant content and advertising. If you choose "ACCEPT ALL", you consent to the use of all cookies. You can accept and reject individual cookie types and revoke your consent for the future at any time under "Settings".</span>
Relevant Tips
Look for bottlenecks that are delaying text rendering
When LCP is not image-based, that often means something is preventing text from appearing sooner. Text visibility may be delayed by blocking scripts or stylesheets, JavaScript-generated content, non-progressive custom font loading, and CSS or JavaScript animations.

2.

The main thread was blocked for 4035 ms

When files block the main thread, users are unable to interact with the page content. Typically, parsing and executing large JavaScript files, as well as running long JavaScript tasks can block the main thread and should be avoided. These files had high thread blocking times:
[... (4 other internal files) ...]
71 ms: https://www.example.com/libraries/cookiesjsr/dist/cookiesjsr-preloader.min.js?v=9.4.8
486 ms: https://www.example.com/libraries/cookiesjsr/dist/cookiesjsr.min.js?v=1.0.13

3.

cookiesjsr.min.js is way too large! It has 105.3 kb!
cookiesjsr-preloader.min.js additionally has 7.6 kb!

Steps to reproduce

Test a COOKiES using site with https://www.webpagetest.org

Proposed resolution

Remaining tasks

  1. Understand the reasons and if we can fix them
  2. Fix them

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024