httpcache
httpcache copied to clipboard
A Transport for http.Client that will cache responses according to the HTTP RFC
When response is JSON and it doesn't have Content-length header and Transfer-encoding header is not chunked, reader will use bufio where we miss the EOF and it never set the...
I needed this for gopls's debugger to know how to run tests from VS Code.
…ght experience errors. httpcache.Transport will pass the http.Request's Context() value to the ContextCache. If the cache experiences an error, it causes the httpcache.Transport to return that error.
Using this library, we noticed a memory leak. We traced it too these response bodies not being able to be closed (becuase they are never passed back)
When MarkCacheResponse is set, this change will add a header if a response got revalidated, so that consumers can detect that. /cc @gregjones
Currently, disk writes fail silently. This leads to surprising and very hard to understand cache misses. /cc @gregjones
Link to a very simple Cache backend support Google Cloud Firestore, Amazon DynamoDB, Azure Cosmos DB, and anything else the Go Cloud project adds to their docstore package.
stale-while-revalidate allows resources that are accessed often to be refreshed asynchronously. This is implemented by a new freshness state that returns the cached response, but triggers an asynchronous request that...