Loading...
 
Skip to main content

Amazon CloudFront


This is to setup a Content delivery network

You need an account with Amazon

  1. Create Distribution
    • Delivery Method: Download
    • Choose Custom Origin
      • Origin DNS Name is the domain name of your site ex.: info.tiki.org
      • Protocol Policy: HTTP Only (unless you know what you are doing)
      • HTTP Port: leave at the default 80 (unless you know what you are doing)
    • Allowed Connections: HTTP and HTTPS
    • CNAMEs: leave empty unless you know what you are doing
    • Default Root Object: leave empty if your siteis at the root. Otherwise, put the subdirectory (ex.: 7x/)
    • Loggin: Off
    • Comments: You can put a comment here to distinguish this distribution from the others.
    • Distribution Status: Enabled
    • Click "continue"
  2. Wait a while for the distribution to be active
  3. Find out your domain name which should be something like abcde12345.cloudfront.net
  4. visit http://abcde12345.cloudfront.net/img/icons/error.png (using the exact domain name provided by cloudfront)
    • This should confirm if it's working. It can take a bit of time before DNS has propagated. If you see a little image, it means the CDN is active.
  5. go the performance admin panel of your Tiki instance
    • tiki-admin.php?page=performance
      • Content Delivery Network: http://abcde12345.cloudfront.net/
      • Content Delivery Network (in SSL): https://abcde12345.cloudfront.net/
  6. Then "view source" of pages rendered by Tiki and you should see abcde12345.cloudfront.net in the code
  7. Empty your cache by visiting tiki-admin_system.php?do=all




Q & A

Q: Everything I've read says you have to upload to S3 (which is separately chargeable) all the files you want to be available, have you done this for the tiki sites and if so what folders/files did you decide should be CDN'd or does the Custom Origin option avoid the use of S3?
A: Custom Origin is much simpler. No need to upload your files to S3. CloudFront takes care of fetching a copy from the original site. Using S3 would be a lot of work because you would have to keep your files in sync. While this could work for images, this is especially problematic for generated files like minified CSS files.

Q: The limited Tiki documentation for CDN says its only for static images and jquery code: would just this subset being CDN'd make any significant difference?
A: Yes, because these files are needed for everyone, whatever the page they visit, vs the download of 1 file. If you do Yahoo! YSlow and Google PageSpeed analysis, you will see that images, JS and CSS are a huge factor.

Q: I use file storage for File Galleries etc - so CDN'ing these could be really useful for improving downloads for some users - but I guess it would not be possible to somehow CDN these?
A: Not with code in Tiki7, but that's a great idea.

Q: When Tiki is set up for CDN, I assume it automatically adds the amazon domain prefix - but presumably only to designated folders (for static images and jquery code?) what is the exact scope of this?
A: Javascript, CSS and some but not all images (no reason not to do them all, just needs to be coded). See the HTML source of a page such as http://themes.tiki.org/Sample+page and look for cloudfront.net For example, IE specific files and some of the images are not covered.