General purpose JavaScript cache methods.