<?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 on: Rails + Caching + XML = Bad Mime Types</title>
	<atom:link href="http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/</link>
	<description>Musings from an independent developer, Cocoa, Rails, and UI for the most part.</description>
	<pubDate>Fri, 21 Nov 2008 02:06:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: videoonlinego</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-60993</link>
		<dc:creator>videoonlinego</dc:creator>
		<pubDate>Mon, 17 Nov 2008 23:47:08 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-60993</guid>
		<description>&lt;p&gt;It is not out-of-date information? Because I have other data on this theme. http://video-online-go.ru/map.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It is not out-of-date information? Because I have other data on this theme. <a href="http://video-online-go.ru/map.html" rel="nofollow">http://video-online-go.ru/map.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: bopdilly</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-60509</link>
		<dc:creator>bopdilly</dc:creator>
		<pubDate>Sun, 16 Nov 2008 12:25:10 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-60509</guid>
		<description>&lt;p&gt;Excellent site! I wish the owner to develop and please all!  http://sex-free-online.ru/map.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Excellent site! I wish the owner to develop and please all!  <a href="http://sex-free-online.ru/map.html" rel="nofollow">http://sex-free-online.ru/map.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: bultalalrylon</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-57949</link>
		<dc:creator>bultalalrylon</dc:creator>
		<pubDate>Tue, 04 Nov 2008 15:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-57949</guid>
		<description>&lt;p&gt;I don't even know,fellow!) continued to write in the same vein, it is interesting people!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I don&#8217;t even know,fellow!) continued to write in the same vein, it is interesting people!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-76</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 29 Nov 2006 03:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-76</guid>
		<description>&lt;p&gt;I also ran into the "Location not allowed here" problem. I think this is due to certain limitation of the Apache setup of your host.
For some reason, FilesMatch does work:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#60;FilesMatch "\.xml$"&#62;
    ForceType application/xml
&#60;/FilesMatch&#62;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It allows me to cache files with .xml extension...&lt;/p&gt;

&lt;p&gt;Tom&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I also ran into the &#8220;Location not allowed here&#8221; problem. I think this is due to certain limitation of the Apache setup of your host.
For some reason, FilesMatch does work:</p>

<pre><code>&lt;FilesMatch "\.xml$"&gt;
    ForceType application/xml
&lt;/FilesMatch&gt;
</code></pre>

<p>It allows me to cache files with .xml extension&#8230;</p>

<p>Tom</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Zornek</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-75</link>
		<dc:creator>Mike Zornek</dc:creator>
		<pubDate>Sun, 19 Feb 2006 12:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-75</guid>
		<description>&lt;p&gt;Adam, I think I like the ForceType solution the best since not all actions in the controller should get the xml file extensions. I tried it however and ran into a problem. When I added the ForceType to my .htaccess file I got an error: &lt;code&gt;Location not allowed here&lt;/code&gt;. Looking at my VirtualHost I am applying All to &lt;code&gt;AllowOverride&lt;/code&gt; so it should work, but it's not. Any ideas?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#60;VirtualHost *&#62; 
ServerName www.clickablebliss.com
ServerAlias clickablebliss.com
ServerAdmin mike@clickablebliss.com
DocumentRoot /webserver/cbwebsite/current/public/
ErrorLog /webserver/cbwebsite/logs/error_log
CustomLog /webserver/cbwebsite/logs/access_log combined
&#60;Directory /webserver/cbwebsite/current/public/&#62; 
    Options ExecCGI FollowSymLinks 
    AllowOverride All 
    Allow from all 
    Order allow,deny 
&#60;/Directory&#62; 
&#60;/VirtualHost&#62;
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Adam, I think I like the ForceType solution the best since not all actions in the controller should get the xml file extensions. I tried it however and ran into a problem. When I added the ForceType to my .htaccess file I got an error: <code>Location not allowed here</code>. Looking at my VirtualHost I am applying All to <code>AllowOverride</code> so it should work, but it&#8217;s not. Any ideas?</p>

<pre><code>&lt;VirtualHost *&gt; 
ServerName <a href="http://www.clickablebliss.com" rel="nofollow">http://www.clickablebliss.com</a>
ServerAlias clickablebliss.com
ServerAdmin <a href="mailto:mike@clickablebliss.com">mike@clickablebliss.com</a>
DocumentRoot /webserver/cbwebsite/current/public/
ErrorLog /webserver/cbwebsite/logs/error_log
CustomLog /webserver/cbwebsite/logs/access_log combined
&lt;Directory /webserver/cbwebsite/current/public/&gt; 
    Options ExecCGI FollowSymLinks 
    AllowOverride All 
    Allow from all 
    Order allow,deny 
&lt;/Directory&gt; 
&lt;/VirtualHost&gt;
</code></pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Stetser</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-74</link>
		<dc:creator>Jacob Stetser</dc:creator>
		<pubDate>Sat, 18 Feb 2006 03:39:04 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-74</guid>
		<description>&lt;p&gt;I believe I just had this working, but through a roundabout fashion. In &lt;strong&gt;routes.rb&lt;/strong&gt;, I had &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;map.connect '/album/:id/images.xml', :controller =&#62; 'album', :action =&#62; 'images'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And when I used &lt;code&gt;caches_page :images&lt;/code&gt; in my album controller, it created &lt;strong&gt;public/album/#/images.xml&lt;/strong&gt;. I don't know if the same will work for you, but perhaps this will get you started down that road?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I believe I just had this working, but through a roundabout fashion. In <strong>routes.rb</strong>, I had </p>

<pre><code>map.connect '/album/:id/images.xml', :controller =&gt; 'album', :action =&gt; 'images'
</code></pre>

<p>And when I used <code>caches_page :images</code> in my album controller, it created <strong>public/album/#/images.xml</strong>. I don&#8217;t know if the same will work for you, but perhaps this will get you started down that road?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Adam C. Greenfield</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-73</link>
		<dc:creator>Adam C. Greenfield</dc:creator>
		<pubDate>Sat, 18 Feb 2006 00:57:14 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-73</guid>
		<description>&lt;p&gt;Oops
&lt;code&gt;s&#124;text/xml&#124;application/xml&#124;&lt;/code&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Oops
<code>s|text/xml|application/xml|</code></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Adam C. Greenfield</title>
		<link>http://blog.clickablebliss.com/2006/02/17/rails-caching-xml-bad-mime-types/#comment-72</link>
		<dc:creator>Adam C. Greenfield</dc:creator>
		<pubDate>Sat, 18 Feb 2006 00:45:58 +0000</pubDate>
		<guid isPermaLink="false">http://65.181.135.246/?p=31#comment-72</guid>
		<description>&lt;p&gt;Well, looking at the &lt;a href="http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_controller/caching.rb?rev=3601"&gt;current Rails caching system&lt;/a&gt; it appears it only supports a single prefix, however it allows you to set the extension using a class attribute &lt;code&gt;ActionController::Caching::Pages.page_cache_extension = '.xml'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You might consider this hack to work this out in your case.
You can simply use the Apache directive &lt;a href="http://httpd.apache.org/docs/1.3/mod/mod_mime.html#forcetype"&gt;ForceType&lt;/a&gt; to set your content type by adding the following to your Apache VirtualHost:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#60;Location /blog/fastrss.html&#62;
ForceType text/xml
&#60;/Location&#62; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you don't want to do that you could crack open ActionController::Caching::Pages and try to scratch your itch that way, but it looks like the code was pretty much only designed to cache one type of file. Changing it to allow for multiple file types (which you could pass as a argument for example) would not be a huge undertaking. It is also worth noting the if you want caching to work for multiple file extensions you end up adding overhead to every request because it will require one RewriteRule per file extension in your .htaccess file (which will be processed, and check the disk on each request)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well, looking at the <a href="http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_controller/caching.rb?rev=3601">current Rails caching system</a> it appears it only supports a single prefix, however it allows you to set the extension using a class attribute <code>ActionController::Caching::Pages.page_cache_extension = '.xml'</code></p>

<p>You might consider this hack to work this out in your case.
You can simply use the Apache directive <a href="http://httpd.apache.org/docs/1.3/mod/mod_mime.html#forcetype">ForceType</a> to set your content type by adding the following to your Apache VirtualHost:</p>

<pre><code>&lt;Location /blog/fastrss.html&gt;
ForceType text/xml
&lt;/Location&gt; 
</code></pre>

<p>If you don&#8217;t want to do that you could crack open ActionController::Caching::Pages and try to scratch your itch that way, but it looks like the code was pretty much only designed to cache one type of file. Changing it to allow for multiple file types (which you could pass as a argument for example) would not be a huge undertaking. It is also worth noting the if you want caching to work for multiple file extensions you end up adding overhead to every request because it will require one RewriteRule per file extension in your .htaccess file (which will be processed, and check the disk on each request)</p>]]></content:encoded>
	</item>
</channel>
</rss>
