WordPress.org

Make WordPress Core

Opened 3 months ago

#43332 new feature request

Better Basic Support for CDN Integration

Reported by: bhubbard Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: Media Keywords:
Focuses: performance Cc:

Description

It has become common practice to setup a CDN for WordPress sites for performance. However many users are not always aware how these work or how they impact your site. Many times these CDNs are complicated to setup, support, and manage. Not only that but it's not uncommon to come across sites using multiple CDNs. Plus, I am not even referring to full cdn urls to scripts that are called by developers with wp_register_script.

For example, we have a client site using MaxCDN, but they also use Jetpack which has Photon. In addition to that they installed WP Stateless. WP Stateless and Jetpack Photon would clearly conflict over media (ie. have same functionality), but the maxcdn can still be used for plugin/theme/core assets, so you can make a case where at least 2 of the CDNs can be used together.

I suggest WordPress has some basic functions to let everyone know what CDNs are being setup and used on a site. Then decisions can be made later on such as cdn priority, how url rewrites are performed, etc. I think a good start would be simply adding a function for developers to register each CDN.

<?php
function wp_register_cdn( $cdn_handle, $cdn_url, $cdn_type, $cdn_priority, $args ) {}

I can see CDN Type being values such as "Media, Assets, Plugin Assets, Core Assets, etc".

Change History (0)

Note: See TracTickets for help on using tickets.