These only happen if the initially-cached request has options.json = true.
- If subsequent requests want json output (
options.json = true), then we try to JSON.parse() the cached content, which is already json, which throws. This causes the cache lookup to fail, so we go get from source again.
- If subsequent requests don't want json output (
options.json = false), then we successfully serve from the cache, but the cached content is json, rather than the expected string content.
I've written some tests demonstrating these behaviours.