Rails wiki site - article edit highlighting / strikethrough with htmldiff maxes cpu

I use a wiki style site and want to highlight the changes made to articles between consecutive versions. Using htmldiff to highlight changes works fine, except that it's pretty intense. I am using the awesome vestal_versions plugin for version control.

So what's the best way to handle this? I believed that the on_create callback when creating the version creates a delayed job that processes and then saves the processed htmldiff article (in the version table row).

If this is a good approach, how can I extend vestal_versions without touching the gem? Or maybe there will be a better approach.

Any advice is greatly appreciated. :)

+3
source share
1 answer

If you already have problems with scaling, I would click it in the browser if possible. How much will it take to port htmldiff to Javascript? If you can push the processor loading into the browser, it will be a victory.

+1
source

Source: https://habr.com/ru/post/1749826/


All Articles