Adding faster pre-cache method to js 'cache array lengths'