Implemetation of caching for site queries
Attempt to fix js exception - but no joy