Edit stash

Optimistic save is a MediaWiki feature to speed up the user-perceived performance of saving page edits. At some point when the UI predicts that the user won't be making further changes (for the plain editing interface this happens when the user focuses on the edit summary field, for VisualEditor when the user opens the save dialog), the current content of the edit area is sent over via AJAX, parsed, and stashed. If the user does indeed save, and no conflicting change has happened in the meantime, the stashed edit is turned into a real revision.

The AJAX request returns the HTML output of the stashed edit, and this can be displayed after saving the page, instead of making the browser reload it (which would take considerably longer). This means the new content of the article can be displayed without the usual Javascript events (load, DOMready etc.), which can confuse JS applications. To avoid this, use the  hook instead of those events.

More information

 * $wgAjaxEditStash
 * the related tickets: T1096