Add system.css_asset and system.js_asset routes to CloudOrchestratorSubscriber

Created on 4 May 2023, over 1 year ago

Problem/Motivation

In Drupal 10.1, the way CSS/JS aggregation has changed. See this issue: https://www.drupal.org/project/drupal/issues/1014086 πŸ› Stampedes and cold cache performance issues with css/js aggregation Fixed . According to this issue, CSS/JS aggregated files are being lazy loaded, where the CSS/JS urls are being written to the HTML first. Then when the asset is being requested, if it doesn't exist, it is generated. If it exists, it is returned via the filesystem.

Because of this, there are two new routes to deal with these assets. system.css_asset and system.js_asset.

In our class CloudOrchestratorSubscriber, we are being very restrictive with access to Cloud module pages. We are booting anonymous users to the Login page if they try to access any routes besides login/forget password..etc...

Anonymous users need access to these routes system.css_asset and system.js_asset. For example, if we use Drush to setup a Cloud Orchestrator site, the aggregated CSS and JS are not built yet. If an anonymous user accesses the user/login, they will see an unstyled page because CloudOrchestratorSubscriber is not letting them access the routes system.css_asset and system.js_asset to build the CSS/JS for the first time.

The fix is to let anonymous users access these two routes.

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States baldwinlouie

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

Comments & Activities

Production build 0.71.5 2024