Office 365 Content Delivery Network (CDN) capability was initially announced for dev preview in September 2016 and Office 365 public CDN was released for general availability during spring 2017. Today, we are excited to also announce general availability for the Office 365 Private CDN. This includes the Publishing feature CDN URL Auto-Rewriting and a set of 1st party web parts that leverage the O365 CDN capability.
Publishing Feature Auto-Rewriting to CDN URLs
This feature detects SharePoint URLs (JS, CSS or IMG) in a Publishing Page during rendering and rewrites them to CDN URLs if they match one of the configured CDN origins. There is no additional configuration required to enable this feature: it will automatically respect the Tenant CDN configuration. In addition to the caching benefits of the CDN, we can use the HTTP/2 protocol for CDN Assets which removes the 6 ports per domain limitation. This feature has been in preview since spring 2007. During that time, we have been engaging with early adopter customers. We have seen this feature to help improve rendering performance of highly customized Publishing Portals that make lots of HTTP requests.
For more details on this feature see the blog post from the General availability of Office 365 CDN.
1st party web part support for Office 365 CDN
The following 1st party web parts now support Office 365 CDN capabilities, which means that if you reference images from CDN enabled libraries or folder, they are automatically served from CDN URLs. This will have a positive impact on the performance of the sites.
- Image (Modern Pages)
- Image Gallery (Modern Pages)
- Hero (Modern Pages)
- Quick links (Modern Pages)
- Title Region (Modern Pages)
- Content by Search (Classic Pages)
- Picture Library Slideshow (Classic Pages)
We are also working to expose this capability for the 3rd party web parts in future so that 3rd party developers can benefit from the performance improvements through CDN capability.
Public CDN vs Private CDN
A common question we get is when to use Public CDN vs. Private CDN. Our recommendation is to use Public CDN for Design Assets and Private CDN for end-user content. By Design Assets we mean the CSS, JS, and Images that are part of the site branding. These assets will generally reside in the Master Page Gallery and Style Library in SharePoint. This allows you to centrally manage these assets and ensure you are comfortable with them being public. For end-user assets like Images, these are much harder to manage so the Private CDN capability works well in these cases by giving the added security while still getting to performance benefits of the CDN.
Since the Private CDN URL is generated by SharePoint with the special tokens they do NOT support relative URLs within the CDN asset. A common scenario might be to have a CSS file with a relative URL to an image. This will work fine with Public CDN, but with Private CDN that request for the relative URL (image) made by the Browser will not have the required tokens in the query string so it will fail. Therefore, the default allowed file extensions for private CDN do not include CSS.
Deprecating old URL format used in developer preview
Notice that we are deprecating the old URL model for the Office 365 CDN which was used during developer preview timeframe. If you are using absolutely URLs based on the URL structure used in the developer preview timeframe, you should ensure that you update your URLs accordingly. These URLs will work until 31st of December 2017, but will not work after that.
https://publiccdn.sharepointonline.com/<tenant host name>/<ID of the public CDN origin>/<sub-path under the origin>
- Use the Office 365 content delivery network with SharePoint Online
- General availability of Office 365 CDN – Public CDN announcement and additional technical details
- Getting started with Office 365 CDN – YouTube video at SharePoint Patterns and Practices YouTube channel
- Hosting client-side web part from Office 365 CDN – Step-by-step tutorial on SharePoint Framework web part hosting in Office 365 CDN
Vesa Juvonen, Senior Program Manager, OneDrive-SharePoint Engineering, Microsoft – 22nd of September 2017