<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Amazon CloudFront: Configuring a CDN in under 5 minutes</title>
	<atom:link href="http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/</link>
	<description>niv singer's rants</description>
	<lastBuildDate>Wed, 02 Jun 2010 15:04:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andy</title>
		<link>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/comment-page-1/#comment-834</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 24 Dec 2008 12:11:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.innerlogics.com/blog/?p=54#comment-834</guid>
		<description>Great post. if you want to use the tool to configure CloudFront service you may want to check out the latest version of CloudBerry Explorer for Amazon S3. http://www.cloudberrylab.com/</description>
		<content:encoded><![CDATA[<p>Great post. if you want to use the tool to configure CloudFront service you may want to check out the latest version of CloudBerry Explorer for Amazon S3. <a href="http://www.cloudberrylab.com/" rel="nofollow">http://www.cloudberrylab.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nivs</title>
		<link>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/comment-page-1/#comment-832</link>
		<dc:creator>nivs</dc:creator>
		<pubDate>Wed, 24 Dec 2008 01:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.innerlogics.com/blog/?p=54#comment-832</guid>
		<description>Thanks Mickey!

I finally finished my &quot;resources compiler&quot; script and I used some of the ideas you wrote about in your comment.
What my script does is to go over all static resources and upload them to S3, renamed to contain their version number.

The script stores the MD5 hash of each resource and compares it to a previous value to detect changes. Naturally, only modified resources are uploaded.

During each run, the script goes over a list of resources to compile. These may be images, or flash files - which are uploaded directly, or CSS and JS files, which are combined and minified before upload. 
CSS files are also scanned for resource file references, which are automatically changed to the versioned file names.

Since I&#039;m using the Smarty template engine, I did not need the script to go over all my source files. I simply added a custom Smarty modifier I called &quot;resource&quot;, which looks up and returns the versioned URL of the requested resource. As a bonus, it can also return the dimensions of image resources.


Two notes about CloudFront that could help others - I&#039;ve spent a lot of time banging my head over this. 
1. If you want to gzip your files, you must upload a gzipped version - CloudFront or S3 don&#039;t do it for you. You should also manually perform browser detection and fetch a non-gzipped version when necessary.
2. Content Headers are critical for uploaded files. Content-Type is a must, and expiration headers (Expires, Cache-Control and Last-Modified) are required to avoid unnecessary hits and for the best user experience. 

I&#039;m still not sure I used the best possible combination of headers for static files.</description>
		<content:encoded><![CDATA[<p>Thanks Mickey!</p>
<p>I finally finished my &#8220;resources compiler&#8221; script and I used some of the ideas you wrote about in your comment.<br />
What my script does is to go over all static resources and upload them to S3, renamed to contain their version number.</p>
<p>The script stores the MD5 hash of each resource and compares it to a previous value to detect changes. Naturally, only modified resources are uploaded.</p>
<p>During each run, the script goes over a list of resources to compile. These may be images, or flash files &#8211; which are uploaded directly, or CSS and JS files, which are combined and minified before upload.<br />
CSS files are also scanned for resource file references, which are automatically changed to the versioned file names.</p>
<p>Since I&#8217;m using the Smarty template engine, I did not need the script to go over all my source files. I simply added a custom Smarty modifier I called &#8220;resource&#8221;, which looks up and returns the versioned URL of the requested resource. As a bonus, it can also return the dimensions of image resources.</p>
<p>Two notes about CloudFront that could help others &#8211; I&#8217;ve spent a lot of time banging my head over this.<br />
1. If you want to gzip your files, you must upload a gzipped version &#8211; CloudFront or S3 don&#8217;t do it for you. You should also manually perform browser detection and fetch a non-gzipped version when necessary.<br />
2. Content Headers are critical for uploaded files. Content-Type is a must, and expiration headers (Expires, Cache-Control and Last-Modified) are required to avoid unnecessary hits and for the best user experience. </p>
<p>I&#8217;m still not sure I used the best possible combination of headers for static files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mickey</title>
		<link>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/comment-page-1/#comment-686</link>
		<dc:creator>Mickey</dc:creator>
		<pubDate>Tue, 18 Nov 2008 21:16:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.innerlogics.com/blog/?p=54#comment-686</guid>
		<description>Hi there,

IMHO (make sure to ask many more people, maybe there are better or simpler solutions) you will have to add to your deployment process a script (whether it&#039;s shell script, PHP, PERL, or whatever) that does 2 things:

1. Iterates all over your static files (images, css, JavaScript, swf etc...) and renames them. For example, if you have a directory called &quot;Images&quot; with 2 files:

image1.jpg
image2.jpg

The script will have to modify the file names to something containing the unique new tag, (or version, or release, or whatever you call it):

image1-3.1.1_200801122.jpg
image1-3.1.1_200801122.jpg

2. The script will also have to go over all your PHP/HTML/JavaScript etc... and change wherever you reference such a file to now hold those new file names, for example:

If example.html has the following line:

 

it will need to be changed to 

 

If example.php  has the following line:

unlink(&quot;image2.jpg&quot;);

it will need to be changed to 
unlink(&quot;image1-3.1.1_200801122.jpg&quot;);

If you are lucky enough you probably have a good chance to find such open source script somewhere, where you only have to define some variables or constants like, what directories to search for static content, in what directories your PHP scripts live, what is the new unique tag (or version, or release, or whatever you call it) etc...

Let me know if you find such a script, I&#039;m sure I could use it some day :-)

Good luck!</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>IMHO (make sure to ask many more people, maybe there are better or simpler solutions) you will have to add to your deployment process a script (whether it&#8217;s shell script, PHP, PERL, or whatever) that does 2 things:</p>
<p>1. Iterates all over your static files (images, css, JavaScript, swf etc&#8230;) and renames them. For example, if you have a directory called &#8220;Images&#8221; with 2 files:</p>
<p>image1.jpg<br />
image2.jpg</p>
<p>The script will have to modify the file names to something containing the unique new tag, (or version, or release, or whatever you call it):</p>
<p>image1-3.1.1_200801122.jpg<br />
image1-3.1.1_200801122.jpg</p>
<p>2. The script will also have to go over all your PHP/HTML/JavaScript etc&#8230; and change wherever you reference such a file to now hold those new file names, for example:</p>
<p>If example.html has the following line:</p>
<p>it will need to be changed to </p>
<p>If example.php  has the following line:</p>
<p>unlink(&#8220;image2.jpg&#8221;);</p>
<p>it will need to be changed to<br />
unlink(&#8220;image1-3.1.1_200801122.jpg&#8221;);</p>
<p>If you are lucky enough you probably have a good chance to find such open source script somewhere, where you only have to define some variables or constants like, what directories to search for static content, in what directories your PHP scripts live, what is the new unique tag (or version, or release, or whatever you call it) etc&#8230;</p>
<p>Let me know if you find such a script, I&#8217;m sure I could use it some day :-)</p>
<p>Good luck!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
