With recent developments in the Cloud Space, CDN is getting more popular and no wonder Microsoft has come to offer CDN capability for Office 365. In this article, let us briefly discuss the Office 365 CDN.
What is a CDN?
Content delivery networks or CDNs are used by most of the cloud/internet services. Cloud services or websites have multiple users accessing the same set of content such as images, icons etc. from multiple locations across the world. It's more efficient to put all this generic content as close to the users as possible. CDNs do this by storing the content in multiple CDN datacenters that spread across the world.
Office 365 CDN
Microsoft provides CDN capability as part of your Office 365 subscription which you can leverage to improve performance of your SharePoint pages. You can host all of your static contents/assets in this CDN. This works as a geographically distributed cache by caching all this content closer to the user requesting it. It also allows you to host static assets in multiple locations or origins.
The best part is O365 CDN is included as part of your subscription and you don’t need to pay extra for it. But what you don’t get are the advanced confrontational options that you get with any CDN provider. But considering its simplistic operational efficacy, it is one of the most suitable options.
Office 365 CDN Types
There are two types of CDNs you get from O365: Public & Private
Public CDN
- Assets hosted using a public CDN are accessible by anyone anonymously. For this reason, you should never host any files that are considered sensitive to your company.
- Below are the steps to how assets are hosted to a public CDN & accessed
- Administrator enables public CDN at your O365 tenant
- Assets to be hosted over CDN are published to the SharePoint libraries that are configured as public CDN origins
- All the published assets are propagated to the CDN
- URLs pointing to the CDN are available to use within your SharePoint sites, pages & webparts
Things to be aware of:
- Removing an asset from a public origin may take up to 30 days to clear from the CDN cache. But the links to the CDN will be invalidated within 15 minutes.
- Though you can hardcode a public origin URL to access your assets from CDN, its not recommended as if the CDN becomes unavailable it would not refer back to your SharePoint URL. Instead it's suggested to use your SharePoint URLS and allow SharePoint to automatically rewrite the URL to CDN URL
- Assets with extensions .css, .eot, .gif, .ico, .jpeg, .jpg, .js, .map, .png, .svg, .ttf, and .woff are allowed by default and any new additions can be done by configuring the CDN
- It is possible to exclude certain assets that has been identified by site classifications you have specified.
Private CDN
Assets hosted using a private CDN are meant to be used internal to your company; i.e., your SharePoint portal. All these assets are security trimmed and only users with permissions can access them.
Below are the steps as to how assets are hosted to a public CDN & accessed
- Administrator enables public CDN at your O365 tenant
- Assets to be hosted over CDN are published to the SharePoint libraries that are configured as private CDN origins
- All the published assets are propagated to the CDN
- When an asset is requested by a URL, SharePoint automatically rewrites the asset's URL to CDN URL
- Assets must have a major version published and user must have access to the assets while the rewriting happens to access the asset successfully.
Things to be aware of:
- Removing an asset from a private origin may take an hour to clear from the CDN cache. But the links to the CDN will be invalidated within 15 mins
- .gif, .ico, .jpeg, .jpg, .js, and .png are the file types allowed by default for a private CDN. This can be updated by changing the CDN configuration
- Like public origins, we can exclude assets that have been identified by site classifications
Start using your O365 CDN now to get a better performance.