Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.7k views
in Q2A Core by
edited by

With settings that anonymous can answer, the ckeditor.js gets loaded on nearly each page (117KB-370KB) even if not needed. So I think we could speed up things, only loading the editor when needed.

We could use jquery's getScript to load it only when needed, i.e. no answer or answer button clicked.

117KB-370KB bandwidth for "nothing" (98 % of my visitors do not answer if there is an answer) is a lot.

Q2A version: 1.5.4
by
Anyway, it is too late now and I must think about the entire issue more carefully. I will report back on any solution :)

FYI:
not loading ckeditor + captcha: 211KB - 16 requests
loading ckeditor  + captcha: 363 KB - 32 requests
by
You are right, one needs to define exactly what he wants here.

First, what should which usergroup see and second how can one reduce the load.

It depends a lot of the admins preferences....
by
Scenario / Goal:

Anonymous visitor -> no answer/comment form -> visitor clicks on answer/comment button -> a/c form gets loaded (page reload)

Logged-in User -> always display answer/comment form

That should be the implementation.
by
Hej monk333, I think I got it done with some if statements! Please see http://www.question2answer.org/qa/27681/how-to-load-ckeditor-only-if-clicked-button-answer-or-comment

Please log in or register to answer this question.

...