Closed prabalsingh24 closed 4 years ago
@championswimmer @jatinkatyal13 what do you think of this approach? Since lang
is required in all the routes. I fetched it from DB in the start and stored in res.locals.langs.
Fetching from DB is not a heavy operation given the number of rows will be very limited. Eager loading it means increased complexity and you would require a server restart if a new language is added
you would require a server restart if a new language is added
langs
are fetched everytime for each request. Just like API key of each request are verified. langs are also updated in res.locals.langs
in each request
We may or may not need langs in each request. E.g. polling
Performance improvements are not significant and in most cases worse with respect to the complexity introduced. Although a nice effort but closing this for now.
fixes #65