I have a web application in which the client-side editor edits really big text that is known on the server side.
The client may make any changes to this text.
What is the most efficient network efficient way to convey the difference in results as the server understands? Also, since this will happen on the client side (Javascript), I would also like it to be “fast” (or at least not noticeably slow)
Some scenarios:
- User changes the ONE character
- User changes several offers in random positions.
- The user deletes everything and displays empty text.
I cannot use diff-like syntax, since it is not efficient on the network, it checks lines where examples 1 and 3 will give terrible differences (especially the last one, where the result will be larger than the old one).
Anyone have any experience with this? The user works on a really large dataset - about 3-5 MB of text, and downloading all the "new" content is a big no-no.
To be clear, I am looking for a “transfer protocol”; string comparison is not a problem.
source
share