rx-angular
rx-angular copied to clipboard
feat(isr): Compression
Problem Solved By The Feature
The size of the page could be really big without compression.
Solution
Add an option to store cache html as compressed and return with compressed html and compress header directly
Additional Context
Since we have lots of pages and size are pretty big as well. With compress, it makes the whole process more efficiently like the traffic between redis and return the compressed html directly.
Should we make the compression pluggable? So the users can provide their own compression? I'd like to have this as a config that they can provide a compress function, this way they can use whatever they need to do with it.
That is a great idea. I will see if I can make it.
Just realized I need to add another change to this PR. Currently cache handler take string as value. But with compress function, it should take Buffer as value. so the value could be either Buffer or String, it will only be Buffer if compress feature is enabled.
Buffer to Base64 string could grow as much as 40% in size.
I feel like it shouldn't count as breaking change, since it is more like it can accept either way.
on the other hands, Angular 19 is coming, maybe we just catch this chance and push to v19 😆