There are quite a few things you can do to bring down the filesize; some are quick and easy, others more involved. The easy ones first:
Other ways of cutting down the code size require a bit more consideration:
You can reduce the size of your udm-custom.js
configuration file
by 10K or more, simply by removing most of the comments and
whitespace from within the customisation arrays.
You'll still be able to edit it later on by referring
to the online or
downloadable manual for details of
each variable.
So for example, this custom array:
//menu behaviors
um.behaviors = [
'250', // open timer ["milliseconds"|"0"]
'600', // close timer ["milliseconds"|"0"]
'yes', // reposition menus to stay inside the viewport ["yes"|"no"]
'default', // manage windowed controls for win/ie ["default","hide","iframe","none"]
];
Can be reduced down to this:
um.behaviors = ['250','600','yes','default'];
Observers will note how the original array has a trailing comma, while the concatenated array does not. The trailing comma is there purely to reduce potential confusion when using the expanded array; leave it or take it out - it doesn't make any difference.
Anyway have a look at the following two files and you'll see what a profound difference this makes overall - the filesize has dropped from 13K to 2K:
The main menu script is also available in two stripped-down versions, so you can choose to sacrifice features you don't need or don't mind losing in favour of smaller, and therefore faster scripts:
If you want to use one of these versions simply change your
udm-dom.js
script include to point to that instead -
you should already have them in your udm-resources
folder.
Then note which features are not available:
As udm-dom.js
except:
See the "lite" menu script demo to see it in action.
As udm-dom-lite.js
except:
See the "ultra-lite" menu script demo to see it in action.
With a plain stylesheet (average 6K), a concatenated custom file (2K), the required control script (5K) and the "ultra-lite" menu script (11K) - the smallest configuration is 24K. But for best accessibility I would recommend keeping the keyboard navigation module (6K), which means using at least the "lite" version (16K), and bringing the total up to 35K. If you use the full menu script then it's 40K.
All the scripts, style sheets and images will be cached after their first use, unless a visitor has their browser set not to do that.
UDM 4 is valid XHTML, and in our judgement, meets the criteria for WAI Triple-A conformance.