Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
A new all files except CSS+JS
option that's available right in the CDN UI, and that would ship as the new default configuration of the CDN module would make sense:
- it's more valuable to load CSS & from origin, because the connection to origin is already open and they are the blocking resources
- all other files are not blocking the page from being rendered, and are usually larger (in terms of number of bytes to transfer) and would therefore benefit more from a CDN
- this then happens to also work around the symptom of the #1988968: Drupal.ajax does not guarantee that "add new JS file to page" commands have finished before calling said JS Drupal core bug
See #2811615-5: [upstream] [Core bug, fixed since 9.5] AJAX commands that need additional JS to be loaded will fail when JS is loaded from CDN + #2811615-6: [upstream] [Core bug, fixed since 9.5] AJAX commands that need additional JS to be loaded will fail when JS is loaded from CDN.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2827998-9.patch | 15.9 KB | Wim Leers |
Comments
Comment #2
Wim LeersThis is the PoC patch from #2811615-7: [upstream] [Core bug, fixed since 9.5] AJAX commands that need additional JS to be loaded will fail when JS is loaded from CDN.
Comment #3
Wim Leers#2 was just cosmetic changes; it did not yet have any effect. Now it does.
Comment #4
Wim LeersAnd now with an upgrade path, plus test coverage.
Comment #5
Wim LeersSelf-review.
s/Install and update/Update/
s/configuration/settings/
IDK how this snuck in here. Unrleated change.
Outdated, should now say 'nocssjs'.
This is validation that should have already existed. Should be done in a separate issue.
Both of these should put the assertion logic in single quotes.
Out of scope, should be fixed in a separate issue.
Again out of scope.
"blacklist" should be replaced with "negative conditions" everywhere?
Comment #6
anavarreRegistering a massive +1 here. Sane defaults mean less reasons for people to run into issues when they don't know what they're doing.
Comment #7
Wim LeersAddressed everything in #5, except the removal of out-of-scope changes. Opened #2828150: Clean-up + one piece of missing validation for that, and now getting that committed first.
Comment #8
Wim Leers#2828150: Clean-up + one piece of missing validation landed. Rebased.
Comment #9
Wim Leerss/rest configuration/default CDN settings/
Fixed.
Comment #10
Wim LeersI think this is ready. Thanks, Aurelien, for your feedback! It's much appreciated :) And it helps convince me that this is the right call.
Comment #11
Wim LeersComment #13
Wim LeersComment #14
Wim LeersGiving issue credit to Aurelien.