Globalize, partial, cache

Hello,

I have a problem or don’t have :slight_smile:
Please check following if i did right:

I have a web pages, that includes partials. Also i used Globalize plugin
for translating web-pages. I get a problem with caching partials when
used next code:

<% cache “header” do %>
<%= render :partial => ‘/header’ %>
<% end %>
But after this header cached with one language,and changing language no
make changing header.

So i try this code(method get_cuurent_lang returns string with current
lang or default):

<% cache “header-#{get_current_lang}” do %>
<%= render :partial => ‘/header’ %>
<% end %>
And i got header-us-US, header-ru-RU cached pages.

Thanks

Well, if this working fine, then you did everything fine. You need to
specify language to caching mechanism. The best way to understand
fragment caching, is to investigate ‘/tmp/cache’ folder.