Office 365 – Enable Office 365 CDN for your SharePoint Online tenant

With Office 365 CDN (Content Delivery Network) you can improve the performance when accessing your SharePoint Online tenant by using a geo-distributed caching proxy; only static content (like picture files) is cached.

This CDN capability can be a great improvement when accessing content hosted on your tenant when connected from a location far away from your Office 365 hosting location.

This capability can also be used by developer to improve access to their application developed on top of SharePoint Online.

Check if CDN is enabled

As usual with Office 365, you will need to use the SharePoint Online PowerShell – as usual recommendation always try to use the latest version  available at https://www.microsoft.com/en-us/download/details.aspx?id=35588

  • Logon to your SharePoint tenant

$cred = Get-Credential

Connect-SPOService -Url https://<your tenant>-admin.sharepoint.com -Credential $creds

  • Get your current tenant configuration

Get-SPOTenant | fl *cdn*

Check the value for PublicCdnEnabled parameter; if the value is False, then this is not enabled

image

Enable CDN

As you are already authenticated and connected thanks to the previous step, just run the command

Set-SPOTenant -PublicCdnEnabled $true

You also update the default file types allowed for CDN using the command

Set-SPOTenant -PublicCdnAllowedFileTypes "CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF,TXT"

Add the a CDN origin; this is the URL pointing to the document library (or asset library) you want to enable for CDN

New-SPOPublicCdnOrigin –URL https://<your tenant>.sharepoint.com/.sites/doclib

You can see the list of all CDN origin using the command Get-SPOPublicCdnOrigins

If you need to remove a CDN origin, just use Remove-SPOPublicCdnOrigin –Identity <id> where the ID is the value of the ID parameter you got using the Get-SPOPublicCdnOrigins

Leave a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.