I know I've brought this up before, but since I'm back to working with Actinic (and since we've been gifted this great new board), I thought I'd flag it up again.
Currently, scripts make up the majority of our page size. An average page has about 544Kb of scripts, a figure dwarfing the combined size of the page's images. The culprit of this is Act_section_tree and its bloated progeny, and much of this is unnecessary.
For example, the first few lines of our Act_section_tree_names.js reads as follows:
Which could be neatly trimmed thus:
Which, of itself, is not much of a saving. But multiplied by the number of sections on the site and it becomes a huge reduction. It does result in a variable with a useless name, but I feel this is justified in this particular case.
Act_section_tree_URLSs.js is an even worse offender. Again, taking an example from our site:
This thing is huge. It's the single largest element on any of our pages ,and most of it is completely redundant. Some simple editing gets it down to this:
This is a dramatic reduction. Getting rid of line breaks, whitespace and anything else that's not needed would further reduce the size. These files never need to be read by a human, so making them readable is pointless.
Another solution (although an unlikely one) would be to use AJAX to get the information. File size is a much more precious commodity than the client's processing power, and doing it this way will allow the page to load gradually rather than having to take that huge initial hit.
This seems to be a pretty simple fix to me, and would be a huge benefit to us and anyone else using the section_tree files for anything.
Thanks.
Currently, scripts make up the majority of our page size. An average page has about 544Kb of scripts, a figure dwarfing the combined size of the page's images. The culprit of this is Act_section_tree and its bloated progeny, and much of this is unnecessary.
For example, the first few lines of our Act_section_tree_names.js reads as follows:
Code:
var section_tree_names = new CreateArray(40); section_tree_names[1].sName = "Apple"; section_tree_names[1].pChild= new CreateArray(6); section_tree_names[1].pChild[1].sName = "Apple compatible laser printer supplies"; section_tree_names[1].pChild[2].sName = "Apple Stylewriter I / II / 1200 printer";
Code:
var a = new CreateArray(40); a[1].sName = "Apple"; a[1].pChild= new CreateArray(6); a[1].pChild[1].sName = "Apple compatible laser printer supplies"; a[1].pChild[2].sName = "Apple Stylewriter I / II / 1200 printer";
Act_section_tree_URLSs.js is an even worse offender. Again, taking an example from our site:
Code:
var section_tree_URLs = new CreateArray(40); section_tree_URLs[1].sURL = "http://www.ourratherlongurl.co.uk/cgi-bin/ss000099.cgi?SECTIONID=Apple%5fPrinter%5fSupplies%2ehtml&NOLOGIN=1"; section_tree_URLs[1].pChild= new CreateArray(6); section_tree_URLs[1].pChild[1].sURL = "http://www.ourratherlongurl.co.uk/cgi-bin/ss000099.cgi?SECTIONID=copy%5fof%5fApple%5fcompatible%5flaser%5fprinter%5fsupplies%2ehtml&NOLOGIN=1"; section_tree_URLs[1].pChild[2].sURL = "http://www.ourratherlongurl.co.uk/cgi-bin/ss000099.cgi?SECTIONID=Stylewriter%5fI%5f%5f%5fII%5f%5f%5f1200%2ehtml&NOLOGIN=1";
Code:
b = new CreateArray(40); u = "http://www.ourratherlongurl.co.uk/cgi-bin/ss000099.cgi?SECTIONID=" l = "%2ehtml&NOLOGIN=1" b[1].sURL = u+"Apple%5fPrinter%5fSupplies"+l; b[1].pChild= new CreateArray(6); b[1].pChild[1].sURL = u+"copy%5fof%5fApple%5fcompatible%5flaser%5fprinter%5fsupplies"+l; b[1].pChild[2].sURL = u+"Stylewriter%5fI%5f%5f%5fII%5f%5f%5f1200"+l;
Another solution (although an unlikely one) would be to use AJAX to get the information. File size is a much more precious commodity than the client's processing power, and doing it this way will allow the page to load gradually rather than having to take that huge initial hit.
This seems to be a pretty simple fix to me, and would be a huge benefit to us and anyone else using the section_tree files for anything.
Thanks.
Comment