Consider disabling script/style concatenation
dd32 opened this issue · 2 comments
Occasionally in Safari I get a unstyled admin page, seemingly because the wp-admin/load-styles.php call failed or timed out.
If static files are simpler for it to serve, it would be beneficial to remove the concatenation, as it serves no purpose other than to reduce network round time trips and most admin pages will have a different set of styles/scripts causing the browser caches to be ignored.
This can be done by using the following, which disables concatenation and gzip'ing of static resources.
define( 'CONCATENATE_SCRIPTS', false );
https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php is full of other interesting constants to explore.
I think that's a great idea @dd32! Here's what needed to make it a reality:
- Define a constants, e.g. in
_runWordPressCode - Remove the static assets from the WordPress
.databundle inprepare-wordpress.sh. There is even some prior art under the$LAZY_FILESif statement. Lazy files aren't that useful and could be removed as a concept, and the code inside thatifcould be repurposed. - Rebuild the WordPress bundle with
npm run build:wpand test if it worked withnpm run dev
Would you like to give it a try?