[wp-trac] [WordPress Trac] #58433: WP version in Etag header in load-styles.php file

WordPress Trac noreply at wordpress.org
Thu Jun 15 22:36:04 UTC 2023


#58433: WP version in Etag header in load-styles.php file
-------------------------------------------------+-------------------------
 Reporter:  dav4                                 |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-         |     Focuses:
  testing-info has-screenshots                   |
-------------------------------------------------+-------------------------

Comment (by ironprogrammer):

 Thanks for the PR, @peterwilsoncc 🙌🏻

 == Test Report
 Patch tested: https://github.com/WordPress/wordpress-develop/pull/4618.
 This covers both `load-scripts.php` and `load-styles.php`, reflecting
 updates noted in comment:11.

 === Environment
 - Hardware: MacBook Pro Apple M1 Pro
 - OS: macOS 13.4
 - Browser: Safari 16.5, Google Chrome 114.0.5735.106
 - Server: nginx/1.25.0
 - PHP: 7.4.33
 - WordPress: 6.3-alpha-55505-src
 - Also, Postman v10.15.1 (see Additional Notes)

 === Actual Results
 - Simple Test:
   - ✅ Etag is now emitted and differs between separate calls to `load-
 scripts.php`.
   - ✅ Etag is now emitted for `load-styles.php`.
 - Advanced Test:
   - ✅ Etag changes for the `load-scripts.php` response when a script
 version changes, e.g. bumping `jquery-core` to `3.7.1`.
   - ✅ Etag changes for the `load-styles.php` response when a script
 version changes, e.g. adding a version to `common`, ''a la''
 `$styles->add( 'common', "/wp-admin/css/common$suffix.css", array(),
 '1.0.0' );`.
 - Testing `HTTP 304 Not Modified`:
   - ✅ When `If-None-Match` is sent, the server responds with the expected
 `304`.

 === Additional Notes
 For the `304` response test using Postman:
 1. Configure a GET request, such as `http://YOUR-SERVER/wp-admin/load-
 scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-
 migrate,utils&ver=6.3-alpha-55505-src`.
 2. Copy the Etag value returned.
 3. Add the `If-None-Match` header to the request, setting its value to the
 Etag.
 4. Resend the request, and a `304` should return.

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


More information about the wp-trac mailing list