For future reference, our coding standards say there are spaces around concatenation operators. This line should have been:

var path = '/cache/' + lastcache + '/' + elgg.config.viewtype + '/' + type + '/' + view;