[wp-trac] [WordPress Trac] #44229: Use CDNs where possible to serve external assets like jQuery
WordPress Trac
noreply at wordpress.org
Wed May 30 10:04:22 UTC 2018
#44229: Use CDNs where possible to serve external assets like jQuery
-------------------------+------------------------------
Reporter: jacklenox | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by jacklenox):
Replying to [comment:7 SergeyBiryukov]:
> Unless I'm missing something, there will still be an HTTP request to an
unavailable resource before switching to fallback, leading to a slower,
not faster experience.
Ah I see. Yes, this is a consideration. There are a number of ways this
could be mitigated:
- When the CDN doesn't respond, a cache value could be set to not bother
trying it again for a predetermined amount of time, perhaps indefinitely.
As soon as the local version of jQuery is loaded, there is no longer a
case for trying to provide the client with the CDN version. The cache
value could include country data which would prevent future users from the
same country experiencing this problem.
- There could be an option to unset a constant that would allow people to
disable the CDN in their wp-config. E.g. something like `define(
'WP_USE_CDN', false );`
I think in the vast majority of cases, the CDN option would work fine,
save a lot of energy and represent an improvement for most users.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44229#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list