Klaro significantly adds to anonymous visitor page weight
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3493438. -->
Reported by: [catch](https://www.drupal.org/user/35733)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Found via <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/drupal_cms/-/work_items/3491405" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/drupal_cms/-/work_items/3491405</a></span>.</p>
<p>The anonymous front page test shows about 245kb of JavaScript, this is uncompressed.</p>
<p>I looked in devtools to see where all this was coming from.</p>
<p>klaro-no-css.js is 65kb compressed, 212kb uncompressed.</p>
<p>The one js aggregate is 7.5kb, 22kb uncompressed.</p>
<p>A significant part of the js aggregate is Klaro Javascript from Klaro's Drupal library this is 10k uncompressed.</p>
<p>So more than 90% of the JavaScript for an anonymous user comes from Klaro.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>There's already an issue against the Klaro module here: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/klaro/issues/3491681" title="Status: Closed (fixed)">#3491681: Klaro library is way too large</a></span>, and the Klaro project here <a href="https://github.com/klaro-org/klaro-js/issues/527">https://github.com/klaro-org/klaro-js/issues/527</a> however I think this needs its own Drupal CMS tracking issue - e.g. maybe there is a lighter solution altogether elsewhere in contrib.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue