Developer forum

Forum » CMS - Standard features » RichText editor - slow loading...

RichText editor - slow loading...

Jacob Storgaard Jensen
Reply

Hi, I'm working on a Azure hosted site right now, (DW 9.6.13) and when you open an item/paragraph with a RichText editor on it, the editor takes forever to load.

When inspecting the network traffic it looks like /Admin/Editor/ckeditor/styles.ashx takes forever to return the script compiled from the styles.xml... When turning this off in the editor settings, it loads fast as lightning... The content of styles.xml is very short - only 12 lines...

When it finishes loading with styles.xml loading on, my Firefox console says:

The script from “https://XXX/Admin/Editor/ckedi…Files%2fTemplates%2fDesigns%2feCommerce%2fstyles.xml&t=12.54” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. ParagraphEdit.aspx

Any ideas?


Replies

 
Nicolai Pedersen
Reply

The way DW loads the styles.xml is by loading a url pointing to the solution it self. So that is probably why it is slow on azure.

I have no idea or workaround other than we rewrite the loading of that styles.xml file.

BR Nicolai

 
Jacob Storgaard Jensen
Reply

Ok, I'll have the guy administering the Azure site look into it...
And I just checked on a Rapido demo on HN servers with the same styles.xml and it loads as fast as if had it not loaded the xml, but it throws the same MIME type warning as on the Azure site...
Does your xml load function do a "file exists" check before it tries to load the xml? It's just because I've noticed slow responses when uploading files through the file management... could maybe be some kind of bad config on the Azure site in the way it handles files etc... don't know just guessing :-)

 
Nicolai Pedersen
Reply

Since it is http request to the xml file, we cannot do a fileexist. Cannot see how it is affected by uploading in the file manager - not sure I understand.

It could be bad config of Azure - or just how Azure works. There is a lot of things that works a bit different on that platform - it could be that it is not allowed to request itself (server-to-server), or if you do, it will roundtrip a lot of virtual routes/firewalls making it slow.

Also disk performance of Azure web apps is very different compared to regular virtual servers.

BR Nicolai

 
Jacob Storgaard Jensen
Reply

The Filemanager thought was just that had you had a fileexist then those two interactions with the "disk" could have been related speedwise... And as you write this could be a place for us to start :-)

We'll dig a little, because this is very very annoying :-D We're talking 15-20 seconds...

 
Jacob Storgaard Jensen
Reply

For everybody else having these issues, here's a follow up with a solution/workaround to the slow Azure loading of the styles.xml... well, is to not use the styles.xml laugh

I created a new editor config with the "Do not load styles.xml" checkmark on, created a new editor configuration .js-file and put my styles definitions into it.

System/Editor/ckeditor/config/YOURCONFIGNAME.js

CKEDITOR.editorConfig = function (config) {
    // Define changes to default configuration here.
    // For the complete reference:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    // The toolbar groups arrangement, optimized for two toolbar rows.
    config.toolbarGroups = [
        { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
        { name: 'links' },
        { name: 'insert' },
        { name: 'tools' },
        { name: 'document', groups: [ 'mode' ] },
        '/',
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph', groups: [ 'list', 'indent', 'align' ] },
        { name: 'styles' },
        { name: 'colors' }
    ];

    // Remove some buttons, provided by the standard plugins, which we don't need to have in the Standard(s) toolbar.
    config.removeButtons = 'Subscript,Superscript,Table,TextColor,Font,Flash,NewPage,Save';

    config.stylesSet = [
        { name: 'Checked List', element: 'ul', attributes: { 'class': 'checked-list' } },
        { name: 'Unchecked List', element: 'ul', attributes: { 'class': 'unchecked-list' } },
        { name: 'Checked Item', element: 'li', attributes: { 'class': 'checked-item' } },
        { name: 'Unchecked Item', element: 'li', attributes: { 'class': 'unchecked-item' } }
    ];

    // config.stylesSet = 'my_styles';
    // config.stylesSet = 'my_styles:/Admin/Editor/ckeditor/styles.aspx?url='+encodeURIComponent('Admin/Public/EditorXMLConfig.aspx')+'&name=my_styles';
    // config.stylesSet = 'my_styles:/styles.js';

    // config.contentsCss = '/Files/System/Editor/ckeditor/styles.css';

    // config.extraPlugins = 'stylesheetparser';

    config.filebrowserBrowseUrl = '/Admin/Editor/ckeditor/browser.aspx?type=link';
    config.filebrowserImageBrowseUrl = '/Admin/Editor/ckeditor/browser.aspx?type=image';

    config.wordcount = {
        countHTML: false,           // Whether or not to include Html chars in the Char Count
        maxWordCount: -1,           // Maximum allowed Word Count, -1 is default for unlimited
        maxCharCount: -1,           // Maximum allowed Char Count, -1 is default for unlimited
        showCharCount: true,        // Whether or not you want to show the Char Count
        showWordCount: true,       // Whether or not you want to show the Word Count
        showParagraphs: false,      // Whether or not you want to show the Paragraphs Count
        countSpacesAsChars: true,   // Whether or not you want to count Spaces as Chars
    };
};

 

 
Nicolai Pedersen
Reply

Nice, and much better implementation and how it should work!

Thanks for sharing.

BR Nicolai

 

You must be logged in to post in the forum