Skip to content
A cached http client for the KrakenD framework
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Gopkg.lock deps ugraded Oct 30, 2018
LICENSE initial commit Feb 20, 2018
http.go use the brand new transport package Oct 30, 2018

Krakend HTTP Cache

A cached http client for the KrakenD framework

Using it

This package exposes two simple factories capable to create a instances of the proxy.HTTPClientFactory and the proxy.BackendFactory interfaces, respectively, embedding an in-memory-cached http client using the package The client will cache the responses honoring the defined Cache HTTP header.

import 	(

requestExecutorFactory := func(cfg *config.Backend) proxy.HTTPRequestExecutor {
	clientFactory := httpcache.NewHTTPClient(cfg)
	return func(ctx context.Context, req *http.Request) (*http.Response, error) {
		return clientFactory(ctx).Do(req.WithContext(ctx))

You can create your own proxy.HTTPRequestExecutor and inject it into your BackendFactory

You can’t perform that action at this time.