• This repository has been archived on 18/Apr/2021
  • Stars
    star
    264
  • Rank 155,103 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An RFC7234 compliant golang http.Handler for caching HTTP responses

httpcache

httpcache provides an rfc7234 compliant golang http.Handler.

wercker status

GoDoc

Example

This example is from the included CLI, it runs a caching proxy on http://localhost:8080.

proxy := &httputil.ReverseProxy{
    Director: func(r *http.Request) {
    },
}

handler := httpcache.NewHandler(httpcache.NewMemoryCache(), proxy)
handler.Shared = true

log.Printf("proxy listening on http://%s", listen)
log.Fatal(http.ListenAndServe(listen, handler))

Implemented

  • All of rfc7234, except those listed below
  • Disk and Memory storage
  • Apache-like logging via httplog package

Todo

  • Offline operation
  • Size constraints on memory/disk cache and cache eviction
  • Correctly handle mixture of HTTP1.0 clients and 1.1 upstreams
  • More detail in Via header
  • Support for weak entities with If-Match and If-None-Match
  • Invalidation based on Content-Location and request method
  • Better handling of duplicate headers and CacheControl values

Caveats

  • Conditional requests are never cached, this includes Range requests

Testing

Tests are currently conducted via the test suite and verified via the CoAdvisor tool.

Reading List

More Repositories

1

alfred-github-jump

An alfred plugin to quickly jump to a github repository page
Go
129
star
2

pheasant

A lightweight data mapper designed to take advantage of PHP 5.3+
PHP
101
star
3

regreph

A tool for detecting performance regressions in PHP codebases
PHP
50
star
4

go-touchid

Go
41
star
5

phpup

Run a minimal apache instance for a given php script or directory
PHP
37
star
6

pass-share

Securely split a master passphrase into shares for recovery post ☠️
HTML
31
star
7

ecsy

A command-line tool for provisioning and managing AWS ECS clusters
Go
25
star
8

octopi

A graph database built on top of mysql using a node adjacency table and joins for traversal.
PHP
19
star
9

bkl

Run Buildkite Pipelines locally
Go
17
star
10

facade

A PHP5 library for accessing files over a variety of protocols via a generic interface
PHP
14
star
11

package-proxy

A reverse proxy for caching package managers
Go
12
star
12

localbtc-php

A PHP5.3 client for localbitcoins.com API
PHP
12
star
13

ec2spot

A tool for analyzing AWS EC2 spot pricing data
Go
11
star
14

alfred-timezone

An alfred workflow for searching timezones
Go
10
star
15

apt-proxy

A caching proxy specifically for apt package caching
Go
9
star
16

inotify-mitm

An LD_PRELOAD hook for relaying network fsevents to Linux
C
8
star
17

parfait

A command-line tool for creating and managing cloudformation stacks.
Go
8
star
18

docker-compose-buildkit

Go
7
star
19

buildkite-test-analytics-go

Golang support for Buildkite Test Analytics
Go
7
star
20

patchwork

Patchwork allows for seeking over io.ReaderAt and io.WriteAt in golang
Go
6
star
21

go-servejs

A golang http.Handler that executes javascript
JavaScript
6
star
22

dotfiles

Lachlan's Dot Files
Shell
5
star
23

babelcoin

A generic api in golang to access and interoperate between various cryptocurrency exchanges
Go
4
star
24

s3-bench

A golang benchmark for PUT and GET for all the s3 regions
Go
3
star
25

govmomi-vmfork

Go
3
star
26

specialk-php

A 5 and 7 card holdem hand evaluator in PHP
PHP
3
star
27

better-gmail-unsubscribe

A chrome extension that adds an unsubscribe link to gmail messages
JavaScript
3
star
28

node-sass-build-alpine-binaries

Shell
2
star
29

alfred-buildkite-jump

An Alfred plugin to quickly jump to a given Buildkite Pipeline
Go
2
star
30

cloudformation-templates

Example CloudFormation templates
Shell
1
star
31

php-orm-benchmark

A benchmark for mysql-based PHP ORM's
PHP
1
star
32

desmoosh

Splits a string without spaces into words
PHP
1
star
33

evaluate

Go
1
star
34

unsplash-go

A client library and CLI for unsplash.com
Go
1
star
35

geoip-docker-image

Geoip Docker Image
Shell
1
star
36

buildkite-accounter

Go
1
star
37

opencoindata

Cryptocoin exchange data for all.
Go
1
star
38

docker-bluejeansrelay

A docker image for Blue Jean's Relay
Shell
1
star
39

chdocker

Easily download and switch to different versions of docker, docker-compose and docker-machine
Shell
1
star
40

bash-shellwords

Tokenize a string into words, respecting quotes
Shell
1
star
41

macstadium-guides

1
star
42

kitewrk

Benchmark lots of parallel Buildkite jobs
Go
1
star
43

windows-2016-vmware-packer

PowerShell
1
star
44

sysbox-packer

A packer template for building a sysbox base image
Shell
1
star