moved upstream logic to gc.Upstream to be more consistent with other middleware
format
initial work on caching, with support for grace and saint mode