added token cache
fixed cache bugs
fixed key len to 512