wordpress-playground icon indicating copy to clipboard operation
wordpress-playground copied to clipboard

Enable networking by default

Open bgrgicak opened this issue 1 year ago • 7 comments

Having networking disabled by default is a performance improvement, but working networking is something most of us expect out of the box. I suggest that we enable networking by default and allow disabling it to improve user experience.

@adamziel @brandonpayton what do you think?

bgrgicak avatar Apr 11 '24 07:04 bgrgicak

I'd be more than happy to do that if it didn't add 5-10 seconds to loading /wp-admin and random screens. It makes the difference between "oh it's so fast" and "oh it's so slow" at the expense of an occasional "oh something isn't loading". Perhaps we could tactically block or pre-fetch specific api.wp.org requests though to make it faster.

adamziel avatar Apr 11 '24 08:04 adamziel

Perhaps we could tactically block or pre-fetch specific api.wp.org requests though to make it faster.

We will eventually need to preload "everything" if we want offline support (#1086). When we have that, it might be a good time to reconsider enabling networking by default.

bgrgicak avatar Apr 11 '24 08:04 bgrgicak

@adamziel @bgrgicak, what does the performance cost of enabling networking come from?

brandonpayton avatar Apr 11 '24 16:04 brandonpayton

@brandonpayton /wp-admin won't render until all the network calls are finished, and requesting api.wp.org using fetch() is not as fast as native network implementation running on a server with a fast network connection.

adamziel avatar Apr 11 '24 22:04 adamziel

@adamziel thanks, that helps! As a random thought, are there any api.wp.org requests that we could reasonably intercept and provide stub data for?

brandonpayton avatar Apr 11 '24 22:04 brandonpayton

I think we could pre-fetch or stub most of them! I'd only run "synchronously" the ones where it actually fetches a filtered list of patterns, plugins, themes.

adamziel avatar Apr 11 '24 22:04 adamziel

I think we could pre-fetch or stub most of them! I'd only run "synchronously" the ones where it actually fetches a filtered list of patterns, plugins, themes.

Speculative Loading - could be helpful to offset speed loss https://make.wordpress.org/core/2024/04/09/speculative-loading-in-wordpress/

flexseth avatar Apr 25 '24 10:04 flexseth