<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>innerlogics/blog &#187; caching</title>
	<atom:link href="http://www.innerlogics.com/blog/tag/caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innerlogics.com/blog</link>
	<description>niv singer's rants</description>
	<lastBuildDate>Fri, 30 Jul 2010 08:29:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Amazon CloudFront: Configuring a CDN in under 5 minutes</title>
		<link>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/</link>
		<comments>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:05:10 +0000</pubDate>
		<dc:creator>nivs</dc:creator>
				<category><![CDATA[aws]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cloudfront]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.innerlogics.com/blog/?p=54</guid>
		<description><![CDATA[I was very thrilled to hear about the public release of Amazon&#8217;s much awaited CDN service dubbed CloudFront. It took me 5 minutes to configure and start using it to serve static content off it (I used S3 for static content until now, so the transition was easy). Prepare an .aws-secrets file to store your [...]]]></description>
			<content:encoded><![CDATA[<p>I was very thrilled to hear about the public release of Amazon&#8217;s much awaited CDN service dubbed <a href="http://aws.amazon.com/cloudfront/">CloudFront</a>. It took me 5 minutes to configure and start using it to serve static content off it (I used <a href="http://aws.amazon.com/s3/">S3</a> for static content until now, so the transition was easy).</p>
<ol>
<li>Prepare an <code class="filename">.aws-secrets</code> file to store your AWS access identifiers and get the <a title="Stored on CloudFront... :)" href="http://d1nqj4pxyrfw2.cloudfront.net/cfcurl.pl"><code class="filename">cfcurl.pl</code></a> script (<a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/GettingStartedGuide/ToolsYouNeed.html">tutorial</a>).</li>
<li style="text-align: left;">Define a Distribution. Save this snippet in a file called <code class="filename">create_request.xml</code>:<br />
<code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;DistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2008-06-30/"&gt;<br />
<span style="color: #c0c0c0;">..</span>&lt;Origin&gt;<span style="color: #ff0000;">YourBucketNameHere</span>.s3.amazonaws.com&lt;/Origin&gt;<br />
<span style="color: #c0c0c0;">..</span>&lt;CallerReference&gt;20080930090000&lt;/CallerReference&gt;<br />
<span style="color: #c0c0c0;">..</span>&lt;CNAME&gt;<span style="color: #ff0000;">cdn.example.com</span>&lt;/CNAME&gt;<br />
<span style="color: #c0c0c0;">..</span>&lt;Enabled&gt;true&lt;/Enabled&gt;<br />
&lt;/DistributionConfig&gt;</code></li>
<li style="text-align: left;">Run the following command:<br />
<code>./cfcurl.pl --keyname <span style="color: #ff0000;"><em class="replaceable"><code>&lt;key name from .aws-secrets file&gt;</code></em></span> -- -X POST -i -H "Content-Type:text/xml; charset=UTF-8" --upload-file <span style="color: #ff0000;">create_request.xml </span>https://cloudfront.amazonaws.com/2008-06-30/distribution</code></li>
<li>Save the response (especially the E-Tag) for later, you may need it to update the configuration.</li>
<li>Create a CNAME entry in your DNS server using the DomainName in the response.</li>
<li>Done!</li>
</ol>
<p><strong>I&#8217;m trying to think about an elegant way to manage versioning from now on (in PHP).</strong> I used to add a query-string version parameter to each resource to deal with client-side caching. With CloudFront, I need actual filenames to change, since Amazon&#8217;s servers ignore the query-string parameters when fetching the file from the S3 origin. Any ideas would be greatly appreciated!</p>
<p><em><strong>Update</strong>: </em><em>see <a href="http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/comment-page-1/#comment-832">comment below</a></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innerlogics.com/blog/2008/11/amazon-cloudfront-configuring-a-cdn-in-under-5-minutes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
