lox / httpcache

An RFC7234 compliant golang http.Handler for caching HTTP responses
MIT License
264 stars 28 forks source link

Add a mutex per key, use same storeMutex across all stores #3

Closed lox closed 10 years ago

lox commented 10 years ago

Previously there was a single mutex in MapStore and FileStore that locked access to the contents. This didn't work for copies, as multiple locks were needed at the same time.

This also changes the Store API to return a WriteCloser for Write and a ReadCloser for Read. This is more go-like and easier to work with.