Organizations are serving a broader and more geographically disperse audience than ever before. Organizations that have a global reach may experience latency when trying to load content across the globe. Content Delivery Networks (CDNs) use edge servers to deliver content closer to the client application that requested it. Instead of a client application in Europe accessing a server in Northern California, content can be delivered from edge servers in Europe. CDN Settings allow us to control how often the edge servers return to the origin in Northern California to fetch updated content. The benefit here is twofold, less performance hit on the origin server and less latency for the end users.
ArcGIS Enterprise can take advantage of CDNs to push static files to edge locations. In this example, we use Amazon's CDN Service (CloudFront) to distribute static ArcGIS Enterprise files across the globe, allowing for quicker load times and less load on the back-end server. This blog details: content and its corresponding context path that are candidates for edge caching, a walk-through of how to use AWS CloudFront in front of ArcGIS Enterprise, and some additional considerations when using a CDN.
The first user in a particular edge server region always gets a request delivered directly from the origin. Subsequent users in that same region are then served content from the edge cache. Requests continue to be delivered from the edge servers until the configured Time To Live (TTL) is met.
More information on Amazon CloudFront:
ArcGIS Enterprise inherently supports secure content which requires a token to access. This content is not a good candidate for caching, as it changes frequently and each user obtains a different token. This will make all requests forward to the origin instead of being served from the edge cache.
ArcGIS Enterprise servers a mix of dynamic and static content. When adding a CDN in front of ArcGIS Enterprise it is important to understand the different type of content that should be cached. If we cache content that is meant to be dynamic, errors may occur in your applications. Below you can find a breakdown of the context paths and the associated content for both Portal for ArcGIS and ArcGIS Server.
ArcGIS Enterprise also serves a significant amount of static content, such as: CSS, JavaScript, HTML files, and images. This content changes infrequently and is generally a good candidate for edge caching. Below you can find some examples of static content that are good candidates for an edge server and dynamic content, but that is not ideal for edge caching.
Static Content (context path) | Dynamic Content (context path) |
---|---|
Portal JS Files (portal/home/10.7.1/*) | Sharing API (portal/sharing/*) |
Portal HTML Files (portal/*.html) | Portal Admin (portal/portaladmin/*) |
Portal JavaScript API (portal/jsapi/*) | |
Portal Image Files (portal/home/images/*) |
* The above examples all use a Web Adaptor name "portal". If you named your web adaptor something different, replace the "portal" with you web adaptor name
* The JavaScript API will have to be updated depending on what version of ArcGIS Enterprise you are using
Static Content | Dynamic Content |
---|---|
Tiled Services (server/rest/services/<Service Name>/MapServer/tile/*) | Sharing API (server/sharing/*) |
Select Queries from Map Services * |
* The above examples all use a Web Adaptor name "server". If you named your web adaptor something different, replace the "server" with you web adaptor name
There are three steps to deploying your ArcGIS Enterprise with CloudFront. The first step is creating the distribution and specifying what the default behavior for the cache is. This step is critical, as it allows dynamic content to pass thru the edge servers and onto the origin. The second step is adding additional cache behaviors. This step provides the ability to cache specific path patterns from the distribution. The final step is to map the existing DNS Record Set to the CloudFront distribution CNAME.
Note: The Origin Domain Name will be the Load Balancer or Server that your ArcGIS Enterprise is accessible from. In this example we use the an Application Load Balancer but other properties are supported here as well. CloudFront will forward requests to this location when populating it's edge cache.
Note:Ensure the default behavior of Cache Based on Selected Request Headers is set to None to support portal's Dynamic Content.
3. Point your DNS records to the CloudFront CNAME