ckeditor_help_delegate($path) does something like:
// On *all* pages :
if (ckeditor_path('local') != '<URL>') {
$do_not_touch_configjs = '<p>' . t('It is recommended to not edit the !ckeditor_config_file .... [long string]').
}
switch ($path) {
// On a couple specific paths, return some help text.
// *One* case uses the $do_not_touch_configjs string prepared above
}
That results in the t() call being executed on every single page view. Since the string is longer than 75 chars, it is not cached in the locales cache, and executing that t() call results in a needless db query for the translation, on every page.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2367913-useless_locale_query-2.patch | 2.23 KB | yched |
Comments
Comment #1
yched commentedMore specifically, that affects sites:
- whith locale.module enabled
- that use a locally downloaded version of the ck library.
Comment #2
yched commentedPatch moves the code around to only compute the variables in the case/switch branch that actually needs them.
Comment #3
jcisio commentedLooks good. Committed and pushed. Thanks.