Search code examples
flashvideo-streamingcdnrtmpamazon-cloudfront

Content-Delivery-Networks (CDN) like AWS Cloudfront, policies, optimal use


Is this a typical 'CDN' policy ? Is this to encourage customers to host only such content that is going to be around for quite a while, and going to see probably a million downloads ?

I started looking at AWS Cloudfront for it's ability stream RTMP media (aka Flash server like behaviour) to host video content. That is to say, I am not too concerned about the "distribution close to client" benefit. However, what surprised me is a clause on the AWS Cloudfront pricing page, that says something like the first 1000 'cancellations' (per month) are free. I interpret 'Cancellation' to the be the act of removal of content that I no longer wish to serve via the CDN. Is that right ?

My requirement is the ability to serve media content (streaming audio, streaming video) which isn't shared with general public or a large audience. It is something like each of these files have a lifetime (or relevance) for only few days (a week or so, at most), and each file will be viewed only by a small handful of people/consumers (e.g. 1 file viewed by an average of 3 people, maximum say 10 people). Also the content's privacy needs to be maintained, so an accidentally shared media URL shouldn't allow an unauthorized person to access it. In this case, is it right to assume that CDN is an overkill, not the right solution ?

I was drawn to AWS CF for it low price (at least, low entry price) for RTMP streaming abilities. What other options could I consider. For me, high availability and round-trip-time are secondary... primary concern being cost, i.e. it needs to be as low as possible. On the question of "how low", I'd say low-enough for developing economies, s.a. in Asia, South America and Africa. Looking for suggestions on the right approach.


Solution

  • Answering myself, as I found it at AWS site here

    By default, files delivered through Amazon CloudFront are publicly readable by anyone on the Internet. However, if you require greater control over who can download or stream your files, you can use Amazon CloudFront’s private content feature. When this option is enabled, Amazon CloudFront will only deliver files or stream media when you say it is okay to do so by securely signing your requests. There is no additional charge for using the private content feature.

    Amazon CloudFront uses the expiration period you set on your files (through cache control headers) to determine whether it needs to check the origin for an updated version of the file. If you expect that your files will change frequently, the best practice is to use object versioning to manage these changes. To implement object versioning, you create a unique filename in your origin server for each version of your file and use the file name corresponding to the correct version in your web pages or applications. With this technique, Amazon CloudFront caches the version of the object that you want without needing to wait for an object to expire before you can serve a newer version.

    You can also remove copies of a file from all Amazon CloudFront edge locations at any time by calling the Invalidation API. This feature removes the file from every Amazon CloudFront edge location regardless of the expiration period you set for that file on your origin server. If you need to remove multiple files at once, you may send a list of files (up to 1,000) in an XML document. The invalidation feature is designed to be used in unexpected circumstances, e.g., to correct an encoding error on a video you uploaded or an unanticipated update to your website’s css file. However, if you know beforehand that your files will change frequently, it is recommended that you use object versioning to manage updates to your files. This technique gives you more control over when your changes take effect and also lets you avoid potential charges for invalidating objects.