Fix typos in caching script. Inline auth header function.