[wp-trac] [WordPress Trac] #58433: Improve Etag-based cache busting for styles and scripts

WordPress Trac noreply at wordpress.org
Thu Apr 4 00:08:08 UTC 2024


#58433: Improve Etag-based cache busting for styles and scripts
-------------------------------------------------+-------------------------
 Reporter:  dav4                                 |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  6.6
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-         |     Focuses:
  testing-info has-screenshots commit            |
-------------------------------------------------+-------------------------
Changes (by ironprogrammer):

 * keywords:  has-patch needs-testing has-testing-info has-screenshots
     needs-refresh => has-patch needs-testing has-testing-info has-
     screenshots commit


Comment:

 Thanks for the refresh, @peterwilsoncc! Still looks good, so marking for
 `commit` consideration.

 == Test Report
 Confidence check: Refresh of https://github.com/WordPress/wordpress-
 develop/pull/4618 (comment:20). LGTM 👍🏻

 === Environment
 - Hardware: MacBook Pro Apple M1 Pro
 - OS: macOS 14.4.1
 - Browser: Safari 17.4.1
 - Server: nginx/1.25.4
 - PHP: 8.2.17
 - MySQL: 8.0.27
 - WordPress: 6.6-alpha-57778-src

 === Actual Results
 - ✅ Etag is now emitted and differs between separate calls to `load-
 scripts.php`.
 - ✅ Etag is now emitted for `load-styles.php`.
 - ✅ Etag changes for the `load-scripts.php` response when a script
 version changes, e.g. bumping `jquery-core` back down to `3.7.0` in
 `script-loader.php` (see supplemental section for details).
 - ✅ When `If-None-Match` is sent with matching Etag, the server responds
 with the expected `304`.
 - ✅ When `If-None-Match` is sent with non-matching Etag, the server
 responds with `200`, returning the latest resource.
 - ✅ Confirmed that Etags are marked with weak indicator: `W/`.

 === Supplemental Assets
 Example header info demonstrating script version change:
 {{{
 URL: http://wp-src.test/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D
 =jquery-core,jquery-migrate,utils&ver=6.6-alpha-57778-src

 ETag: W/"15ed1817ff7302e64fb57cf8f1033f0e" <-- jquery-core 3.7.1
 ETag: W/"5dc93d2f474f0d8d7d397ed510e8dcd8" <-- jquery-core 3.7.0
 (modified)
 ETag: W/"15ed1817ff7302e64fb57cf8f1033f0e" <-- jquery-core 3.7.1
 (restored)
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58433#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list