<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Multilingual page caching in Ruby on Rails</title>
	<atom:link href="http://szeryf.wordpress.com/2008/02/02/multilingual-page-caching-in-ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://szeryf.wordpress.com/2008/02/02/multilingual-page-caching-in-ruby-on-rails/</link>
	<description>The blog with the bug.</description>
	<lastBuildDate>Mon, 26 Oct 2009 20:00:20 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jan</title>
		<link>http://szeryf.wordpress.com/2008/02/02/multilingual-page-caching-in-ruby-on-rails/#comment-1054</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Thu, 01 Oct 2009 11:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=39#comment-1054</guid>
		<description>Works really well. It took me forever to get localization based on subdomains working. And boy was I mad when I realized that it destroys my page caching. very, very glad I found this page. Thanks a lot!

I use de.foo.bar and en.foo.bar in my project with de and en as locale names, so I didn&#039;t have to use cookies, but used:

RewriteCond %{HTTP_HOST} ^(.+?)\.
RewriteRule ^([^.]+)$ cache/%1/$1.html [QSA]


Also I noticed that my root isn&#039;t cached as locale/index.html but as locale.html so I went for:

RewriteCond %{HTTP_HOST} ^(.+?)\.
RewriteRule ^$ cache/%1.html [QSA]

With built-in rails 2.3 localization:

def cache_page content, path
  super content, I18n.locale + path
end</description>
		<content:encoded><![CDATA[<p>Works really well. It took me forever to get localization based on subdomains working. And boy was I mad when I realized that it destroys my page caching. very, very glad I found this page. Thanks a lot!</p>
<p>I use de.foo.bar and en.foo.bar in my project with de and en as locale names, so I didn&#8217;t have to use cookies, but used:</p>
<p>RewriteCond %{HTTP_HOST} ^(.+?)\.<br />
RewriteRule ^([^.]+)$ cache/%1/$1.html [QSA]</p>
<p>Also I noticed that my root isn&#8217;t cached as locale/index.html but as locale.html so I went for:</p>
<p>RewriteCond %{HTTP_HOST} ^(.+?)\.<br />
RewriteRule ^$ cache/%1.html [QSA]</p>
<p>With built-in rails 2.3 localization:</p>
<p>def cache_page content, path<br />
  super content, I18n.locale + path<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valery</title>
		<link>http://szeryf.wordpress.com/2008/02/02/multilingual-page-caching-in-ruby-on-rails/#comment-1043</link>
		<dc:creator>Valery</dc:creator>
		<pubDate>Wed, 22 Jul 2009 16:05:38 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=39#comment-1043</guid>
		<description>For ngnix it would be like
server {
...
set $locale bg;
if ($http_cookie ~ &#039;locale=(en&#124;bg)&#039;) {
   set $locale $1;
}
... 
location / {
...
try_files /maintenance.html /cache/$locale/$uri.html /cache/$locale/$uri/index.html /cache/$locale/$uri  $uri $uri/index.html $uri.html @modrails; $


...
}</description>
		<content:encoded><![CDATA[<p>For ngnix it would be like<br />
server {<br />
&#8230;<br />
set $locale bg;<br />
if ($http_cookie ~ &#8216;locale=(en|bg)&#8217;) {<br />
   set $locale $1;<br />
}<br />
&#8230;<br />
location / {<br />
&#8230;<br />
try_files /maintenance.html /cache/$locale/$uri.html /cache/$locale/$uri/index.html /cache/$locale/$uri  $uri $uri/index.html $uri.html @modrails; $</p>
<p>&#8230;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jm</title>
		<link>http://szeryf.wordpress.com/2008/02/02/multilingual-page-caching-in-ruby-on-rails/#comment-577</link>
		<dc:creator>jm</dc:creator>
		<pubDate>Wed, 04 Jun 2008 10:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=39#comment-577</guid>
		<description>Great stuff ! Thank you very much for this !

Actually i use subdomains to store language and have the same kind of configuration for nginx like this :

&lt;code&gt;set $lang fr;
if ($host ~* &quot;^en\.yaka&quot;) {
set $lang en;
}
if ($host ~* &quot;^es\.yaka&quot;) {
set $lang es;
}
if ($host ~* &quot;^nl\.yaka&quot;) {
set $lang nl;
}
&lt;/code&gt;
and then i use $lang in the redirection stuff...</description>
		<content:encoded><![CDATA[<p>Great stuff ! Thank you very much for this !</p>
<p>Actually i use subdomains to store language and have the same kind of configuration for nginx like this :</p>
<p><code>set $lang fr;<br />
if ($host ~* "^en\.yaka") {<br />
set $lang en;<br />
}<br />
if ($host ~* "^es\.yaka") {<br />
set $lang es;<br />
}<br />
if ($host ~* "^nl\.yaka") {<br />
set $lang nl;<br />
}<br />
</code><br />
and then i use $lang in the redirection stuff&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wordpress htaccess</title>
		<link>http://szeryf.wordpress.com/2008/02/02/multilingual-page-caching-in-ruby-on-rails/#comment-440</link>
		<dc:creator>wordpress htaccess</dc:creator>
		<pubDate>Mon, 04 Feb 2008 01:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=39#comment-440</guid>
		<description>Whoah!  This is an awesome writeup szeryf!  I will be coming back to read it again in a bit!

~ AskApache</description>
		<content:encoded><![CDATA[<p>Whoah!  This is an awesome writeup szeryf!  I will be coming back to read it again in a bit!</p>
<p>~ AskApache</p>
]]></content:encoded>
	</item>
</channel>
</rss>
