Incorrect Asset URL Generation for Proxy-Enabled Sites

Created on 19 March 2024, 4 months ago

I am encountering a problem with Drupal where we have a problem when generating assets on an instance accessible via a different URL (With proxy).

Steps to Reproduce:
Have a drupal instance accessible via several domains (One with a proxy and the main domain of this proxy redirects to another site)
Navigate to Configuration > Development > Performance, and make sure that bundling of CSS and JS files is enabled.
Access a page of the site via the domain
we notice that when we access the same page using the proxy the files generated by Drupal (CSS and JS) are not accessible

Expected Behavior:
The system must generate the URLs of the compressed assets of an instance accessible via different domains including the basePath.

Solution:
Upon investigation, it was discovered that the issue stems from the URL cache system, which relies on specific variables (such as the theme name, language, etc.) to cache the generated URL. To resolve this, it is recommended to include the basePath as a parameter in the generated ID to ensure the URL is cached correctly based on the base path.

Additional Information:
Drupal version: 10.1
PHP version: 8.1
MySQL version: 5.7
Operating system: Linux
This issue occurs consistently and is not limited to a specific browser or user account.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
Asset libraryΒ  β†’

Last updated 5 days ago

No maintainer
Created by

πŸ‡²πŸ‡¦Morocco ifeddi

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

Comments & Activities

Production build 0.69.0 2024