- Issue created by @sleitner
- @sleitner opened merge request.
- @sleitner opened merge request.
- @sleitner opened merge request.
- πΊπΈUnited States recrit
@sleitner thanks for the patch. The patch fixed it for my build. It now correctly serves JS and CSS with "Content-Encoding: gzip".
My only thought is the quantifier might need to be a "+" instead of "*" since"js_.js"
is not a valid filename.The erroneous changes in #1040534: Rewrite rules for gzipped CSS and JavaScript aggregates cause lots of lstats for files that will never exist β update the RewriteRule to the following:
RewriteRule ^(.*js_[a-zA-Z0-9-_])\.js$ $1\.js\.gz [QSA]
Example Drupal JS filename:
"js_w0tbu2Mi0ldw2g1-6ceMRIw636XPaZoJEvQkqKjxQkE.js"
Bug: The current rule only matches filenames"js_w.js"
- which does not match the Drupal JS filename.
Expected: This rule should match"js_w0tbu2Mi0ldw2g1-6ceMRIw636XPaZoJEvQkqKjxQkE.js"
- π©πͺGermany sleitner
@recrit I change "*" to "+", which should be better. Please review
- πΊπΈUnited States recrit
@sleitner thanks, looks good and worked as expected correctly serving the gzip files
- Status changed to RTBC
over 1 year ago 12:32pm 20 March 2023 - π¬π§United Kingdom catch
I think I introduced the original bug here, fix looks good to me and preserves the behaviour the original issue was trying to fix (not looking for files that will never exist).
- πΊπΈUnited States recrit
@catch Note that this is also a bug for 9.5.x. The 10.x patch applies cleanly to both branches but I also updated the 9.5.x MR with the latest commits.
MR Summary:
- 10.1.x: https://git.drupalcode.org/project/drupal/-/merge_requests/3431
- 9.5.x: https://git.drupalcode.org/project/drupal/-/merge_requests/3290 - Status changed to Fixed
over 1 year ago 2:04pm 30 March 2023 - π¬π§United Kingdom longwave UK
Committed and pushed 1d3e0326a5 to 10.1.x and 7f5e51d92b to 10.0.x and 03de0c83b9 to 9.5.x. Thanks!
Will open a followup to add test coverage to this, as we test other parts of .htaccess.
-
longwave β
committed 7f5e51d9 on 10.0.x
Issue #3336463 by sleitner, recrit, catch: Htaccess rewrite rules for...
-
longwave β
committed 7f5e51d9 on 10.0.x
-
longwave β
committed 1d3e0326 on 10.1.x
Issue #3336463 by sleitner, recrit, catch: Htaccess rewrite rules for...
-
longwave β
committed 1d3e0326 on 10.1.x
-
longwave β
committed 03de0c83 on 9.5.x
Issue #3336463 by sleitner, recrit, catch: Htaccess rewrite rules for...
-
longwave β
committed 03de0c83 on 9.5.x
- π¬π§United Kingdom alexpott πͺπΊπ
I've added the same release note as #1040534: Rewrite rules for gzipped CSS and JavaScript aggregates cause lots of lstats for files that will never exist β - I've also updated the CR. I'm note really sure what we should do for people who updated due to the original issue or started a site in the meantime. Maybe we need to update the original CR for this.
- π¬π§United Kingdom catch
I've made a new CR with the same wording - if people follow the list or anything, it ensures they'll see it again. Agreed with fixing the old one too though.
Automatically closed - issue fixed for 2 weeks with no activity.