[[TOC()]] = [wiki:help/en Cyberduck Help] / [wiki:help/en/howto Howto] / Amazon CloudFront Support = Amazon CloudFront delivers your static and streaming content using a global network of edge locations. Requests for your objects are automatically routed to the nearest edge location, so content is delivered with the best possible performance. You can enable download or streaming distributions using ''File → Info → Distribution'' for a [wiki:help/en/howto/s3 S3] bucket or a custom origin distribution for any other source. == Subscription == You must [http://aws.amazon.com/cloudfront/ signup] for Amazon CloudFront first. You pay only for the data transfer and requests that you actually use. == Permissions == Make sure your objects in the bucket you want to enable distribution for are world readable. In ''File → Info → Permissions'' give `READ` permission to ''Everyone (`http://acs.amazonaws.com/groups/global/AllUsers`)''. == Basic (Download HTTP) Distributions == Delivery method used to serve static content. == Website Configuration Endpoint Distributions == Enable a [wiki:help/en/howto/s3?#WebsiteConfiguration website endpoint] with no CDN features. == Website Configuration Endpoint Distributions with CloudFront CDN == Custom origin CDN distribution with a [wiki:help/en/howto/s3?#WebsiteConfiguration website endpoint] as a source to make use of the website endpoint features in CloudFront. You must also enable the website endpoint to make sure the CloudFront edge locations can fetch the content from the origin. === Reference === * [https://forums.aws.amazon.com/ann.jspa?annID=921 Using CloudFront with the new Amazon S3 static website hosting features] == Streaming (RTMP) Distributions == Delivery method used to serve [http://en.wikipedia.org/wiki/Flash_Video media] using a [http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol streaming protocol]. === Playback Configuration === Copy the `RTMP` URL for a given file in a bucket with a streaming distribution enabled is displayed in the Info window ''Distribution (CDN)'' tab with ''Streaming (RTMP)'' selected as the delivery method. Where to put the URL depends on the client player you are using. * [http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12535/video-delivery-rtmp-streaming JW Player Video Delivery: RTMP Streaming] == Custom Origin (HTTP/HTTPS) Distributions == A [http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?Appendix.html custom origin] is an origin server that isn't hosted on Amazon S3. The origin server holds the original, definitive versions of your content. You can connect to any [wiki:help/en/howto/ftp FTP], [wiki:help/en/howto/ftp SFTP] or [wiki:help/en/howto/dav WebDAV] server and configure it as an origin server for content distribution with Amazon CloudFront in the ''Distribution (CDN)'' tab of the [wiki:help/en/howto/info Info] panel. The hostname from the ''Web URL'' configured in the bookmark is used to configure the origin of the CDN. [[Image(Custom Origin CDN.png)]] * Adjust the [wiki:help/en/howto/bookmarks#WebURL Web URL] of the bookmark to the host where you want to CloudFront look for the original content. * Set the ''Path'' of the bookmark to the document root of your web server. This allows you to select files for [wiki:help/en/howto/cloudfront#ObjectInvalidation invalidation] or set the [wiki:help/en/howto/cloudfront#DefaultRootObject default root object]. * Connect to the server and select the ''Distribution (CDN)'' panel from the [wiki:help/en/howto/info#CDNPanel Info] window. * Check the ''Origin'' URL displayed and enable the distribution with ''Enable Amazon CloudFront distribution''. * Refresh the status of the distribution using ''Command-R''. The initial status is ''In Progress'' and should subsequently change to ''Deployed'' when the changes in Amazon CloudFront have propagated. * Click the ''Where'' URL to load the content over the CDN. '''Example configuration:''' The first time your content is served to a worldwide user (one in Tokyo, for example), a copy of the content is fetched from the origin server and stored in cache on the edge servers in that location. The next time the content is requested, its pulled directly from the cached copy on the edge servers, dramatically reducing delivery time. [[Image(CDN Custom Origin Server.png)]] ||Server||media.cyberduck.ch||''Hostname configured in bookmark to connect to. If this is different than what hostname CloudFront should fetch the origin content from, edit the hostname in the ''Web URL'' of the bookmark.''|| ||CNAME||cdn.cyberduck.ch||''Alias for hostname assigned by the CloudFront distribution''|| ||Bookmark Path||`/usr/home/dkocher/cyberduck.ch/`||''The Web Server Document Root''|| ||Selected File||`/home/dkocher/cyberduck.ch/img/cyberduck.icon.png`||''A file selected in the browser''|| ||HTTP URL||http://media.cyberduck.ch/img/cyberduck.icon.png||''Origin URL for the resource''|| ||CDN URL||http://d15bfu8of7vup8.cloudfront.net/img/cyberduck.icon.png||''URL for the resource assigned by the CloudFront distribution''|| ||CDN CNAME URL||http://cdn.cyberduck.ch/img/cyberduck.icon.png||''URL for resource in CDN with custom hostname registered in the DNS''|| == Deployment Status == Upon changing configuration parameters of a distribution configuration, the settings are not distributed immediatly in the CDN. While the deployment is in progress (which can take up to 15 minutes), the status ''In Progress'' is displayed. The updates are fully propagated throughout the CloudFront system when the distribution's state switches from ''In Progress'' to ''Deployed''. === CloudFront Access Logging === When this option is enabled, access logs are written to `/logs`. The changes to the logging configuration take effect within 12 hours. The logging option is supported for both standard and streaming distributions. === Analytics === After logging is configured, you can access statistics from your access logs using a service such as [https://qloudstat.com Qloudstat]. == Origin == The source of the content where CloudFront fetches the content to be served in the edge location of the CDN. This is a [wiki:help/en/howto/s3 S3] bucket or your custom origin. == Where == The `cloudfront.net` domain assigned to your distribution. This is directing to the edge location in the CDN next to the user requesting an URL. == CNAMEs == Enter a [http://en.wikipedia.org/wiki/CNAME_record CNAME] (alias in the Domain Name System) for the hostname of the distribution given by CloudFront. To use multiple CNAMEs for a single distribution, the hostnames must be space delimited. The CNAME must be registered on the nameserver responsible for your domain and point to `cloudfront.net` domain assigned to your distribution. Example configuration: {{{ ;; QUESTION SECTION: ;cdn.cyberduck.ch. IN A ;; ANSWER SECTION: cdn.cyberduck.ch. 1576 IN CNAME d15bfu8of7vup8.cloudfront.net. }}} == Default Root Object == You can assign a default root object to your HTTP or HTTPS distribution. This default object will be served when Amazon CloudFront receives a request for the root of your distribution – i.e., your distribution’s domain name by itself. When you define a default root object, a user request that calls the root of your distribution returns the default root object. For example, if you designate the file `index.html` as your default root object, a request for `http://d604721fxaaqy9.cloudfront.net/` returns `http://d604721fxaaqy9.cloudfront.net/index.html`. == Object Invalidation == [http://aws.amazon.com/about-aws/whats-new/2010/08/31/cloudfront-adds-invalidation-feature/ Invalidation] is one way to remove a distribution object from an edge server cache before the expiration setting on the object's header. Invalidation clears the object from the edge server cache, and a subsequent request for the object will cause CloudFront to return to the origin to fetch the latest version of the object. Use the Invalidate option ''File → Info → Distribution (CDN)'' to invalidate files from edge locations. == References == * [http://aws.amazon.com/cloudfront/faqs/ Amazon CloudFront FAQs] * [http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?RTMPStreaming.html Streaming Media Files] * [http://aws.amazon.com/cloudfront/#details Edge Locations]