janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
584 stars 40 forks source link

Speed up rendering by limiting template formats #52

Closed janko closed 3 years ago

janko commented 3 years ago

ActionView::LookupContext will by default look up templates in all known formats (33 of them). This results in quite a few system calls, which can slow down rendering, especially when filesystem access is slower (e.g. when using macOS with Docker).

Before processing an action, Action Controller reduces the list of formats only to formats that the current request accepts. However, rodauth-rails is rendering templates outside of action processing, so this code is not being executed. We fix this by calling it manually.

Fixes #48