i18n-js: I18n::JS::Middleware autogeneration not working in Rails 4.2.3
I added config.middleware.use I18n::JS::Middleware in development.rb
but it does not work in rails 4.2.3
can someone reproduce this?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 16
Commits related to this issue
- Fix issue #350 and #355. — committed to hsamadi/i18n-js by deleted user 8 years ago
- clear middleware cache each time middleware is initialized which will resolve issue #350 upon restarting rails — committed to tleish/i18n-js by deleted user 8 years ago
- changelog update for #350 — committed to tleish/i18n-js by deleted user 8 years ago
- Merge pull request #402 from tleish/issue-350-middleware-caching Fix for #350 middleware caching — committed to fnando/i18n-js by PikachuEXE 8 years ago
I’m not following why this would be an issue in production. This isn’t removing caching in the middleware, it’s only resets the caching once after the rails starts. Otherwise after the cache is created, each subsequent request (page refresh) uses the cache from then on. This mimics the same behavior of rails in that it initially loads and caches the yaml files into memory when the application first starts, and then uses the cache from then on.
With my pull request, if someone is using the middleware in production then this would only impact the very first request where it would rebuild the cache and files. Otherwise, it would continue to use the cache until someone restarts rails, which in production usually means a new deployment.
In the meantime, I’ve added this to my rails configuration which does the same thing.