 <p>It depends on what kind of a website it is, but if the changes made to the DOM are meant to be permanent, and changes are only permitted to be made by registered users, I would maybe write the HTML snippet to a file, and keep track of the changes in the database. And then render the HTML snippet every time the page is requested.</p>