I have an application where I use i18n and Globalize3 for models translations. Im implementing page cache right now and wanna know how do you handle page cache with i18n on ruby on rails?
If you stick with the rule: one url = one page, caching is easy.
So easy I don't really know what I could add... just fragment-cache or page-cache.
If you don't have the locale in your url (which is not a good practice), caching would be far more difficult.
from the Rails guides:
You may be tempted to store the chosen locale in a session or a cookie. Do not do so. The locale should be transparent and a part of the URL. This way you don’t break people’s basic assumptions about the web itself: if you send a URL of some page to a friend, she should see the same page, same content. A fancy word for this would be that you’re being RESTful. Read more about the RESTful approach in Stefan Tilkov’s articles. There may be some exceptions to this rule, which are discussed below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With