framework
framework copied to clipboard
Cache recurring subtrees' HTML
Each descriptor should have a hash based on their props and their children...
If the same hashes appear regularly, then that subtree could have its rendered HTML cached and maybe retrieved from /__mayu/cache/:hash.html (something like /__mayu/cache/47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU=.html). So the insert-patch would, instead of sending HTML, send the path to the HTML, and the browser could cache the response.
This could improve speed and bandwidth for static components, and maybe also improve performance because it wouldn't have to serialize the same HTML over and over...
It should probably be easy to add something to the UpdateContext class...
The HTML could be stored in memory, with some timeout that clears them if they haven't been requested in a configurable amount of time.
I did this with https://github.com/aalin/rdom by creating custom elements. Seems to work pretty well.
Would be fixed by #61