victorspringer / http-cache

High performance Golang HTTP middleware for server-side application layer caching, ideal for REST APIs
https://godoc.org/github.com/victorspringer/http-cache
MIT License
339 stars 63 forks source link

Implement skip cache by URI path & response header #21

Open ooaklee opened 4 months ago

ooaklee commented 4 months ago

Motivation

Firstly, this is a great package - thank you. I found that in the use case where someone might have wanted to skip caching particular responses or server paths intentionally, they were previously limited. With these proposed changes, users can specify a regex to restrict the cache's scope or set a previously defined header in their handler function to ensure the response is never cached (suitable for partially loaded site set-up, amongst other use cases).

What's Changed