<?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"
	>
<channel>
	<title>Comments for Sanity Software Wisdom</title>
	<atom:link href="http://keakaj.com/wisdom/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://keakaj.com/wisdom</link>
	<description>Programming Wisdom for Mac OS X and Ruby on Rails Developers</description>
	<pubDate>Mon, 13 Oct 2008 23:09:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>Comment on Cache-Control Header for Amazon S3 by Keaka Jackson</title>
		<link>http://keakaj.com/wisdom/2007/07/27/cache-control-header-for-amazon-s3/#comment-427</link>
		<dc:creator>Keaka Jackson</dc:creator>
		<pubDate>Mon, 23 Jun 2008 17:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/?p=3#comment-427</guid>
		<description>It's been a while, but I believe you include a regular HTTP header in your HTTP PUT request.  So wherever your PHP class generates the actual request to Amazon, you'd add a Cache-Control header to the request.

This "Getting Started Guide" has a "Writing an Object" section with PHP sample code you might be able to use:
http://docs.amazonwebservices.com/AmazonS3/2006-03-01/gsg/</description>
		<content:encoded><![CDATA[<p>It&#8217;s been a while, but I believe you include a regular HTTP header in your HTTP PUT request.  So wherever your PHP class generates the actual request to Amazon, you&#8217;d add a Cache-Control header to the request.</p>
<p>This &#8220;Getting Started Guide&#8221; has a &#8220;Writing an Object&#8221; section with PHP sample code you might be able to use:<br />
<a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/gsg/" rel="nofollow">http://docs.amazonwebservices.com/AmazonS3/2006-03-01/gsg/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Cache-Control Header for Amazon S3 by Travis</title>
		<link>http://keakaj.com/wisdom/2007/07/27/cache-control-header-for-amazon-s3/#comment-425</link>
		<dc:creator>Travis</dc:creator>
		<pubDate>Sat, 21 Jun 2008 09:58:08 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/?p=3#comment-425</guid>
		<description>Do you happen to know the procedure and in what API method the header is ultimately being set so that when the object is put to S3 it has that header stored? I am using a PHP class which works well but I can't figure out how to get my own custom headers (such as cache-control) to be included with the file...</description>
		<content:encoded><![CDATA[<p>Do you happen to know the procedure and in what API method the header is ultimately being set so that when the object is put to S3 it has that header stored? I am using a PHP class which works well but I can&#8217;t figure out how to get my own custom headers (such as cache-control) to be included with the file&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Cache-Control Header for Amazon S3 by Keaka Jackson</title>
		<link>http://keakaj.com/wisdom/2007/07/27/cache-control-header-for-amazon-s3/#comment-423</link>
		<dc:creator>Keaka Jackson</dc:creator>
		<pubDate>Wed, 18 Jun 2008 20:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/?p=3#comment-423</guid>
		<description>I mainly only use s3 for images, so I haven't had to deal with serving gzipped assets yet.</description>
		<content:encoded><![CDATA[<p>I mainly only use s3 for images, so I haven&#8217;t had to deal with serving gzipped assets yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Cache-Control Header for Amazon S3 by Joe Martinez</title>
		<link>http://keakaj.com/wisdom/2007/07/27/cache-control-header-for-amazon-s3/#comment-422</link>
		<dc:creator>Joe Martinez</dc:creator>
		<pubDate>Wed, 18 Jun 2008 02:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/?p=3#comment-422</guid>
		<description>What do you do about gzipping your s3 assets, or do you only use s3 for images?</description>
		<content:encoded><![CDATA[<p>What do you do about gzipping your s3 assets, or do you only use s3 for images?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Amazon SimpleDB by Tom the Golf Pro</title>
		<link>http://keakaj.com/wisdom/2007/12/14/amazon-simpledb/#comment-55</link>
		<dc:creator>Tom the Golf Pro</dc:creator>
		<pubDate>Mon, 17 Dec 2007 06:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/2007/12/14/amazon-simpledb/#comment-55</guid>
		<description>Bah! Who needs SimpleDB when you could be out golfing?</description>
		<content:encoded><![CDATA[<p>Bah! Who needs SimpleDB when you could be out golfing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Cache-Control Header for Amazon S3 by The Whiny Nil &#187; Blog Archive &#187; LINK: Cache-Control Header for Amazon S3</title>
		<link>http://keakaj.com/wisdom/2007/07/27/cache-control-header-for-amazon-s3/#comment-21</link>
		<dc:creator>The Whiny Nil &#187; Blog Archive &#187; LINK: Cache-Control Header for Amazon S3</dc:creator>
		<pubDate>Wed, 31 Oct 2007 14:12:46 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/?p=3#comment-21</guid>
		<description>[...] Cache-Control Header for Amazon S3Amazon provides an option for specifying the Cache-Control header, but we use the AWS::S3 gem and the attachment_fu plugin for uploading our files to S3. The gem and plugin don&#8217;t provide a convenient way to set the Cache-Control header. My solution is to enhance the behavior of the store() method within the AWS::S3 gem so that it always specifies a Cache-Control header of 10 years if another value is not specified. [...]</description>
		<content:encoded><![CDATA[<p>[...] Cache-Control Header for Amazon S3Amazon provides an option for specifying the Cache-Control header, but we use the AWS::S3 gem and the attachment_fu plugin for uploading our files to S3. The gem and plugin don&rsquo;t provide a convenient way to set the Cache-Control header. My solution is to enhance the behavior of the store() method within the AWS::S3 gem so that it always specifies a Cache-Control header of 10 years if another value is not specified. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Cache-Control Header for Amazon S3 by Adrian B. Danieli</title>
		<link>http://keakaj.com/wisdom/2007/07/27/cache-control-header-for-amazon-s3/#comment-8</link>
		<dc:creator>Adrian B. Danieli</dc:creator>
		<pubDate>Thu, 13 Sep 2007 00:40:52 +0000</pubDate>
		<guid isPermaLink="false">http://keakaj.com/wisdom/?p=3#comment-8</guid>
		<description>Nice. I wanted to add "Expires" as well (I know, old school) so here's a tweaked version that does it. This version forces the headers, and uses symbolized keys.

&lt;pre&gt;
require 'aws/s3'

# Adds expiration headers to all stored S3 objects through duck-punching.
# Based on Keaka Jackson's original work.
#
module AWS::S3
  class S3Object
    class &lt;&lt; self
      MAX_AGE = 8.years
      def store_with_cache_control(key, data, bucket = nil, options = {})
        options[:cache_control] = "max-age=#{MAX_AGE.to_i}"
        options[:expires]       = MAX_AGE.from_now.httpdate
        store_without_cache_control(key, data, bucket, options)
      end
      alias_method_chain :store, :cache_control
    end
  end
end

# To update existing photos, run this in production script/console:
#
# Photo.find(:all).each do &#124;p&#124;
#   s3 = AWS::S3::S3Object.find(p.full_filename, 'bucketname')
#   s3.save(:access =&gt; :public_read) unless s3.cache_control &#038;&#038; s3.expires
# end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Nice. I wanted to add &#8220;Expires&#8221; as well (I know, old school) so here&#8217;s a tweaked version that does it. This version forces the headers, and uses symbolized keys.</p>
<pre>
require 'aws/s3'

# Adds expiration headers to all stored S3 objects through duck-punching.
# Based on Keaka Jackson's original work.
#
module AWS::S3
  class S3Object
    class < < self
      MAX_AGE = 8.years
      def store_with_cache_control(key, data, bucket = nil, options = {})
        options[:cache_control] = "max-age=#{MAX_AGE.to_i}"
        options[:expires]       = MAX_AGE.from_now.httpdate
        store_without_cache_control(key, data, bucket, options)
      end
      alias_method_chain :store, :cache_control
    end
  end
end

# To update existing photos, run this in production script/console:
#
# Photo.find(:all).each do |p|
#   s3 = AWS::S3::S3Object.find(p.full_filename, 'bucketname')
#   s3.save(:access => :public_read) unless s3.cache_control &#038;&#038; s3.expires
# end
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.826 seconds -->
