Prerender document <head>
at build time
#22
Labels
A-templates
Area: templates
C-performance
Category: performance
D-easy
Difficulty: easy
P-medium
Priority: medium
S-in-development
Status: in development
Is your feature request related to a problem? Please describe.
Currently, Perseus renders the document
<head>
at runtime only, which, though hardly a huge thing, does mean the server ha to do more.Describe the solution you'd like
At build time, any templates with compatible strategies should have their
<head>
s prerendered to a.head.html
asset, which can be read by the server and interpolated, meaning the server has to do less work. Notably, the generation function for the<head>
is deliberately synchronous, and takes state, but it does render to a string, so it makes sense to prerender it if possible, which might give performance improvements of a few milliseconds. This also makes static exporting significantly easier.Describe alternatives you've considered
At the moment, there's no way to prerender metadata in Perseus, or (to my knowledge) any other Rust framework.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: