Skip to main content

Optimize editor performance (MT4)

james calleja.png
Written by James Calleja
Former MindTouch Employee at MindTouch
This page applies to:MindTouch 4

Configure the MindTouch 4 editor to improve its performance while editing large amounts of content.

These optimizations work best for pages with widgets (comments, paths) and blocks of text. It is recommended that you set a high character limit to trigger these editor optimizations.

 

Optimize editor performance for large pages


These configuration settings are modifiable, and it is recommended you change these settings to suit your needs. We recommend that you set a minimum character limit to trigger optimizations for the autosave and SCAYT settings.

performanceTweaksEnabled_minLength
This configuration value activates the configuration keys (listed below) on pages that contain 50,000 characters. Setting a minimum character amount ensures that these configurations only trigger once the character minimum is met. You can adjust the minimum character amount, with the default value set to infinity. The character count is based on the HTML-generated for that content. You can view the character count by clicking View > Source within the editor toolbar.

CKEDITOR.editorConfig = function( config ) {
    config.performanceTweaksEnabled_minLength = 50000;
}

Autosave settings

Implement these configuration keys alongside the character limit to trigger autosave optimizations. See the Examples section below for implementation details.
 

autosave_interval
The editor saves your content changes every 25 seconds by default. Increasing this value to 50 second intervals reduces the number of changes saved onto your local storage.

CKEDITOR.editorConfig = function( config ) {
    config.autosave_interval = 50;
}


autosave_minLength
Change this value to save after a minimum amount of character changes. The editor saves to your local storage every time you change 120 characters or more.

CKEDITOR.editorConfig = function( config ) {
    config.autosave_minLength = 120;
}


SCAYT (spell check as you type) settings

Implement these configuration keys alongside the character limit to trigger SCAYT optimizations. See the Examples section below for implementation details.
 

scayt_findWordDelay
This configuration lowers the amount of processes occurring while your editor is highlighting each misspelled word. Changing this value increases the time between highlighting spelling errors.

CKEDITOR.editorConfig = function( config ){
    config.scayt_findWordDelay = 1500;
}


scayt_handleCheckDirty
Set this configuration to false to provide better performance on larger amounts of preloaded text.

CKEDITOR.editorConfig = function( config ){
    config.scayt_handleCheckDirty = false;
}

Disabling (setting the key to false) this configuration may affect your autosave functionality.


scayt_handleUndoRedo
Setting this configuration to false uses the native functionality of the editor instead of the SCAYT plugin, enhancing text undo/redo actions.

CKEDITOR.editorConfig = function( config ){
    config.scayt_handleUndoRedo = false;
}


 

Examples


You can modify any of the above configurations to suit your needs. Below are some examples that can be used to improve the users experience. 
 

Triggering configurations by setting a character length:

CKEDITOR.editorConfig = function( config ) {
    config.performanceTweaksEnabled_minLength = 50000;
};

 

Triggering configurations without setting a minimum character length:

CKEDITOR.editorConfig = function( config ) {
    config.performanceTweaks = {
        autosave_interval: 50,
        autosave_minLength: 120,
        scayt_findWordDelay: 1500,
        scayt_handleCheckDirty: false,
        scayt_handleUndoRedo: false
    };
};

 

Triggering the configuration and overriding one of the settings:
CKEDITOR.editorConfig = function( config ) {
    config.performanceTweaksEnabled_minLength = 50000;
    config.performanceTweaks.scayt_handleCheckDirty = true;
}
  • Was this article helpful?