Cache API does not seem to ever match

I’m trying the cache api worker example, and my requests never get cached (or maybe they do and never get matched I can’t tell).
It’s not clear how the api is affected by origin headers.
Also it seems like cache.put should have a time option, maybe I’m just misunderstanding something

I was able to solve this by rewriting the response headers before caching them,