I am working on an app where the navigation menu needs to change based on the options enabled for the user. This fires db queries to check the user privileges every time menu loads.
I want to be able to generate the menu at login and store it as static html for the duration of the session so that db queries are not fired at every page change. What would be the best approach for:
generating the static html by computing the result of a dynamic template (includes if conditions for rendering the menu options)
best approach to store it for the duration of the session and use it in navigation template or view.
Thanks in advance.