Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache recurring subtrees' HTML #18

Open
aalin opened this issue Oct 3, 2022 · 1 comment
Open

Cache recurring subtrees' HTML #18

aalin opened this issue Oct 3, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@aalin
Copy link
Contributor

aalin commented Oct 3, 2022

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.

@aalin
Copy link
Contributor Author

aalin commented Mar 24, 2023

I did this with https://github.com/aalin/rdom by creating custom elements. Seems to work pretty well.

Would be fixed by #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant