This topic is locked
[SOLVED]

 Total JS files size more than 1mb - looking for ways to reduce load.

1/2/2011 3:30:29 PM
PHPRunner General questions
V
velveteen author

There are currently 17 js files referenced by an Add page using CKeditor, with some scripts inline in files. The total file size is more than 1MB, with yuiAll.js taking more than half of the total size. All of them seems to be minified. I could replace CK editor, but I know that I couldn't remove YUI without breaking the pages even if I try.
Has anyone tried using YUI php loader as an alternative? I could try replacing YUI in the generated pages but it'd probably takes weeks.
Line 1: http://localhost/classof2011/include/json.js

Line 31: http://localhost/classof2011/include/cookies.js

Line 46: http://localhost/classof2011/include/lang/English.js

Line 50: http://localhost/classof2011/include/yui/yuiAll.js

Line 2087: http://localhost/classof2011/include/customlabels.js

Line 2092: http://localhost/classof2011/include/ajaxsuggest.js

Line 2181: http://localhost/classof2011/include/jquery.dimensions.js

Line 2185: http://localhost/classof2011/plugins/ckeditor/ckeditor.js

Line 2325: http://localhost/classof2011/include/runnerJS/RunnerControls.js

Line 2835: http://localhost/classof2011/include/jquery.inputhintbox.js

Line 2848: http://localhost/classof2011/include/runnerJS/RunnerPages.js

Line 2906: for(var i=0;i<audioLinks.length;i++){var link=$(audioLinks[i]).attr("href");if(link.substr(0,4)=="http"){var fixedLink=link.replace('http://localhost','http://127.0.0.1';);if(link!=fixedLink){$(audioLinks[i]).attr("href",fixedLink);}}

Line 2911: if(Runner.pages.PageSettings.getTableData(this.tName,"isUseAudio",false)){Runner.util.ScriptLoader.addJS(["http://mediaplayer.yahoo.com/js";]);}

Line 3197: http://localhost/classof2011/include/runnerJS/events/pageevents_specialclasses.js

Line 3208: http://localhost/classof2011/plugins/ckeditor/config.js?t=AA4E4NT

Line 3241: http://localhost/classof2011/plugins/ckeditor/skins/office2003/skin.js?t=AA4E4NT

Line 3250: http://localhost/classof2011/plugins/ckeditor/lang/en.js?t=AA4E4NT

Line 3259: http://localhost/classof2011/plugins/ckeditor/plugins/styles/styles/default.js?t=AA4E4NT

Line 3268: http://localhost/classof2011/include/jquery.js

Line 3647: http://localhost/classof2011/include/runnerJS/RunnerBase.js

Line 3710: http://localhost/classof2011/include/jsfunctions.js

romaldus 1/2/2011



There are currently 17 js files referenced by an Add page using CKeditor, with some scripts inline in files. The total file size is more than 1MB, with yuiAll.js taking more than half of the total size. All of them seems to be minified. I could replace CK editor, but I know that I couldn't remove YUI without breaking the pages even if I try.
Has anyone tried using YUI php loader as an alternative? I could try replacing YUI in the generated pages but it'd probably takes weeks.
Line 1: http://localhost/cla...include/json.js

Line 31: http://localhost/cla...lude/cookies.js

Line 46: http://localhost/cla...lang/English.js

Line 50: http://localhost/cla...e/yui/yuiAll.js

Line 2087: http://localhost/cla...customlabels.js

Line 2092: http://localhost/cla.../ajaxsuggest.js

Line 2181: http://localhost/cla...y.dimensions.js

Line 2185: http://localhost/cla...tor/ckeditor.js

Line 2325: http://localhost/cla...nnerControls.js

Line 2835: http://localhost/cla...inputhintbox.js

Line 2848: http://localhost/cla.../RunnerPages.js

Line 2906: for(var i=0;i<audioLinks.length;i++){var link=$(audioLinks[i]).attr("href");if(link.substr(0,4)=="http"){var fixedLink=link.replace('http://localhost','http://127.0.0.1');if(link!=fixedLink){$(audioLinks[i]).attr("href",fixedLink);}}

Line 2911: if(Runner.pages.PageSettings.getTableData(this.tName,"isUseAudio",false)){Runner.util.ScriptLoader.addJS(["http://mediaplayer.yahoo.com/js"]);}

Line 3197: http://localhost/cla...ecialclasses.js

Line 3208: http://localhost/cla...ig.js?t=AA4E4NT

Line 3241: http://localhost/cla...in.js?t=AA4E4NT

Line 3250: http://localhost/cla...en.js?t=AA4E4NT

Line 3259: http://localhost/cla...lt.js?t=AA4E4NT

Line 3268: http://localhost/cla...clude/jquery.js

Line 3647: http://localhost/cla...S/RunnerBase.js

Line 3710: http://localhost/cla.../jsfunctions.js


please check the "compress javascript files" checkbox before generate your app.

V
velveteen author 1/2/2011



please check the "compress javascript files" checkbox before generate your app.


I did. While phprunner already compresses js files, I tried recompressing with YUI compressor but only managed a 1% compression rate.
The other js files are already minified.
I'd like to add that it's not impossible to remove YUI library after the app is generated but it's probably better to remove YUI reference while building the app and using jQuery UI afterwards. I added jQuery validation on the login page on top of the built in validation.
I wish I tried datatables and tableless layout for the list page but now I only have the generated app with me. Another few months before I could sit down and really learn phprunner though.