small medium large xlarge

21 Jun 2015, 22:02
Felix Buenemann (2 posts)

Rails I18n lookups are uncached by default, which can lead to huge slowdowns especially when rendering tables with eg. localized dates.

There is a big speedup if the memoized backend is used, which caches lookups in memory. I usually have the following code in an initializer:

I18n::Backend::Simple.send(:include, I18n::Backend::Memoize) unless Rails.env.development?

This tip might be worth adding to the rails performance section.

31 Aug 2015, 21:04
Alexander Dymo (9 posts)

Hi Felix, Thanks for the tip! Please include it into the wiki I’ve just started

You must be logged in to comment