More information on Amazon CloudFront:
ArcGIS Enterprise Content:
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.
Portal for ArcGIS
|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 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
|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
Using CloudFront as your CDN with ArcGIS Enterprise:
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.
- Add Cache behaviors to the above created distribution
- Create a CloudFront Distribution:
- From your AWS Console navigate to the CloudFront service under the "Networking & Content Delivery" section.
- Select "Create Distribution" to enter the CloudFront deployment wizard.
- Select "Get Started" under the Web at the "Select a Delivery Method" page.
- Populate the Origin Settings with the following information: (Amazon Documentation on Origin Settings)
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: Note: Ensure you add your DNS to the "Alternate Domain Names". This comes into play when you map your DNS Records Set to the CloudFront Domain Name.
- Find your distribution ID from the CloudFront homepage
- Navigate to the "Behaviors" tab
- Select "Create Behavior"
- Populate the behavior with the followingNote:
Note: Unlike the initial deployment ensure you chose the "Customize" option for "Object Caching". This allows you to specify a default, minimum, and maximum amount of time (in seconds) your object will live in its edge location. You can see mine are set to 86400 (1 day).
- Repeat this step for the following "Path Patterns"Note: The path patterns are related to the table in the "ArcGIS Enterprise Content" Section above. You will notice the path pattern for a tiled map service there as well.
Note: After an upgrade the path pattern for "portal/home/10.6.1" will have to be updated for the specific version of ArcGIS Enterprise you are using.
3. Point your DNS records to the CloudFront CNAME
- These steps come after you have completed the installation and configuration of your ArcGIS Enterprise deployment
- Ensure that the CloudFront cache is invalidated after an upgrade
- Please review the pricing model for Amazon’s CloudFront CDN: https://aws.amazon.com/cloudfront/pricing/