<?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: Outputting resized attachment_fu image, stored in database, with RMagick</title>
	<atom:link href="http://macdiggs.com/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/feed/" rel="self" type="application/rss+xml" />
	<link>http://macdiggs.com/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/</link>
	<description>Digging the watery grave and talking about PHP, Rails and tech stuff..</description>
	<pubDate>Mon, 21 May 2012 14:43:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mike</title>
		<link>http://macdiggs.com/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/comment-page-1/#comment-26911</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Tue, 04 Mar 2008 22:56:03 +0000</pubDate>
		<guid isPermaLink="false">http://macdiggs.com/index.php/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/#comment-26911</guid>
		<description>Hi Joris,

sorry I guess I've been somewhere else when replying. Indeed, all the requests will go 100% through Mongrel. There's a possible solution though (haven't tried it myself though) would be to cache image (as usual, but with the correct extension as I have noted above) and then just setup a, say, media.xxxxxxx.com subdomain for your server, then setup apache to handle this subdomain directly (without passing stuff through mongrel cluster), and serve all the static recompressed images from there. This might be your best bet (that is, no need to google for docs as the solution is already here), but only if you can easily add subdomains to the domain on which your application is hosted.</description>
		<content:encoded><![CDATA[<p>Hi Joris,</p>
<p>sorry I guess I&#039;ve been somewhere else when replying. Indeed, all the requests will go 100% through Mongrel. There&#039;s a possible solution though (haven&#039;t tried it myself though) would be to cache image (as usual, but with the correct extension as I have noted above) and then just setup a, say, media.xxxxxxx.com subdomain for your server, then setup apache to handle this subdomain directly (without passing stuff through mongrel cluster), and serve all the static recompressed images from there. This might be your best bet (that is, no need to google for docs as the solution is already here), but only if you can easily add subdomains to the domain on which your application is hosted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joris Verschoor</title>
		<link>http://macdiggs.com/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/comment-page-1/#comment-26905</link>
		<dc:creator>Joris Verschoor</dc:creator>
		<pubDate>Tue, 04 Mar 2008 10:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://macdiggs.com/index.php/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/#comment-26905</guid>
		<description>Ok, but what if another client (that doesn't have the file in cache) requests for it? It will go 100% though mongrel

What I meant was something like: 
http://blog.kovyrin.net/2006/11/01/nginx-x-accel-redirect-php-rails/</description>
		<content:encoded><![CDATA[<p>Ok, but what if another client (that doesn&#039;t have the file in cache) requests for it? It will go 100% though mongrel</p>
<p>What I meant was something like:<br />
<a href="http://blog.kovyrin.net/2006/11/01/nginx-x-accel-redirect-php-rails/" rel="nofollow">http://blog.kovyrin.net/2006/11/01/nginx-x-accel-redirect-php-rails/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://macdiggs.com/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/comment-page-1/#comment-26884</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 28 Feb 2008 00:53:53 +0000</pubDate>
		<guid isPermaLink="false">http://macdiggs.com/index.php/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/#comment-26884</guid>
		<description>Joris,

you can just add cache_page to the controller serving images and everything should be served directly to user by apache bypassing mongrel/rails completely. You just need the correct extension to be added to the cached file.

Sort of: 
cache_page :thumbnail

As a tip, if you have lots of functions which resize/modify stuff for you in various ways, it might be tedious to add every single one to the cache_page function. I use code like that in my systems:

after_filter lambda { &#124;c&#124; c.cache_page }, :except =&gt; [:post_upload, :post_video, :sanitize_filename, :media_attachment]

which caches everything except for specified (non image-resizing/processing functions)</description>
		<content:encoded><![CDATA[<p>Joris,</p>
<p>you can just add cache_page to the controller serving images and everything should be served directly to user by apache bypassing mongrel/rails completely. You just need the correct extension to be added to the cached file.</p>
<p>Sort of:<br />
cache_page :thumbnail</p>
<p>As a tip, if you have lots of functions which resize/modify stuff for you in various ways, it might be tedious to add every single one to the cache_page function. I use code like that in my systems:</p>
<p>after_filter lambda { |c| c.cache_page }, :except => [:post_upload, :post_video, :sanitize_filename, :media_attachment]</p>
<p>which caches everything except for specified (non image-resizing/processing functions)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joris</title>
		<link>http://macdiggs.com/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/comment-page-1/#comment-26883</link>
		<dc:creator>Joris</dc:creator>
		<pubDate>Thu, 28 Feb 2008 00:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://macdiggs.com/index.php/2007/07/10/outputting-resized-attachment_fu-image-stored-in-database-with-rmagick/#comment-26883</guid>
		<description>Nice piece of code!

Is there a way to let nginx / apache serve the file after it has been created? IIRC there's a way for nginx / lighttpd to set a SEND_FILE variable from your cgi script, and then let them serve the file.

This is also handy for for example files that require a login.</description>
		<content:encoded><![CDATA[<p>Nice piece of code!</p>
<p>Is there a way to let nginx / apache serve the file after it has been created? IIRC there&#039;s a way for nginx / lighttpd to set a SEND_FILE variable from your cgi script, and then let them serve the file.</p>
<p>This is also handy for for example files that require a login.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

