i18n-active_record icon indicating copy to clipboard operation
i18n-active_record copied to clipboard

Does the cache get invalidated across the multi threads?

Open letrungkien opened this issue 8 months ago • 2 comments

I like the idea of this gem and would like to know if the translation cache is invalidated across the multi threads?

For example: Translation for key hello is world

  • Web worker A and B are holding the cache as { en: { hello: 'world' } }
  • A translation update request is sent to Web worker A and updated translation for hello to be zworld, I18n.backend.reload! is called and Worker A will refetch the translations and now has the cache as { en: { hello: 'zworld' } }

Does calling I18n.backend.reload! in Worker A also invalidate caches in Worker B?

letrungkien avatar Jun 04 '24 06:06 letrungkien