AssetResolver may load the same cache several time on a single page with bigpipe

Created on 5 February 2025, 3 months ago

Problem/Motivation

Don't fully understand why yet, but i noticed on our project with redis monitor that there are quite a few identical cache lookups:

"HGETALL" "prefix:data:css:THEME_NAMEenaxHQwg5UBhW9FfRUylgqlvQ43K67H9VuTW3QXt27iZU1"
"HGETALL" "prefix:data:js:THEME_NAMEen:D9AaXzT3MlnOQcjEJMKZEOqJpT9sVkpufRFf2FceqFM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM11"
"HGETALL" "prefix:data:js:THEME_NAMEen:D9AaXzT3MlnOQcjEJMKZEOqJpT9sVkpufRFf2FceqFM11"

There are two unique hashes, the D9A... one is actually all-the-libraries, the NXh hash is an empty array of $libraries_to_load and settings.

Not sure how common this situation is, this also also on 10.4, haven't verified yet if 11.x changes anything.

I'm not sure what this is doing exactly with those assets. Took me a while to find where exactly it's looping, it's in \Drupal\big_pipe\Render\BigPipe::sendNoJsPlaceholders(), which has 23 fragments, all or most seem to be toolbar parts (classic toolbar with admin_toolbar).

Not sure what should be done in this scenario. statically cache the cache? if it's all identical, do we even need to process it or could we somehow return early somewhere?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

asset library system

Created by

πŸ‡¨πŸ‡­Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024