Added the javascript functionality to clear the cache, taken from Martin's fork.