darkweak / souin

An HTTP cache system, RFC compliant, compatible with @tyktechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @go-kratos, @gin-gonic, @roadrunner-server, @zalando, @zeromicro, @nginx and @apache

Home Page:https://docs.souin.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cache-Control: stale-while-revalidate

the-leonat opened this issue · comments

commented

Does souin implement asynchronous background fetching similar to varnish grace setting?
I could not find anything about it in the docs and it seems to ignore my cache-control response header of my upstream webserver.
public, max-age=120, stale-while-revalidate=3600.
after the content turns stale souin replies once with:
Cache-Status: Souin; fwd=uri-miss; key={{key}}-/; detail=UNCACHEABLE-STATUS-CODE

server responds with code 304.

func isCacheableCode(code int) bool {
	switch code {
	case 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501:
		return true
	}

	return false
}

but 304 is not a cacheable status code by implementation. is this a bug?