You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not 100% on what the options for doing this are, but I think we can achieve it if we're a bit clever.
The main reason why the helper is async, is due to the need to fetch the permalink setting. However, settings are cached meaning that this is normally a synchronous operation anyway. Further still, there should be no need to do this more than one per render of a view, so I'm thinking we could perhaps cache the setting either against the helpers or against express with app.set as part of the setup middleware.
It'd probably be good to do something like this with settings & config that affect rendering: url, permalink, activeTheme, postsPerPage etc. URL can only change on a server restart, and the others require settings to be changed, so we could refresh the caches for these object either based on events (something we've talked about elsewhere) or only change the values if they're not set, or if the current request is an admin request.
Just throwing around some thoughts, but the goal remains simple: make {{url}} a normal helper, rather than an async helper.
Removing the need for async helpers at all is a secondary goal as they're unlikely to ever be supported properly.
The text was updated successfully, but these errors were encountered:
I'm not 100% on what the options for doing this are, but I think we can achieve it if we're a bit clever.
The main reason why the helper is async, is due to the need to fetch the permalink setting. However, settings are cached meaning that this is normally a synchronous operation anyway. Further still, there should be no need to do this more than one per render of a view, so I'm thinking we could perhaps cache the setting either against the helpers or against express with
app.set
as part of the setup middleware.It'd probably be good to do something like this with settings & config that affect rendering: url, permalink, activeTheme, postsPerPage etc. URL can only change on a server restart, and the others require settings to be changed, so we could refresh the caches for these object either based on events (something we've talked about elsewhere) or only change the values if they're not set, or if the current request is an admin request.
Just throwing around some thoughts, but the goal remains simple: make
{{url}}
a normal helper, rather than an async helper.Removing the need for async helpers at all is a secondary goal as they're unlikely to ever be supported properly.
The text was updated successfully, but these errors were encountered: