Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached responses always have a 200 status code #36

Open
bertday opened this issue Mar 29, 2017 · 3 comments
Open

Cached responses always have a 200 status code #36

bertday opened this issue Mar 29, 2017 · 3 comments

Comments

@bertday
Copy link

bertday commented Mar 29, 2017

If you hit an endpoint with caching enabled, the first response will have the same status code as the underlying API response. Any requests after that will return 200, even if the original response was an error.

image

@themightychris
Copy link
Member

Good catch, did the original 404 response include cache control headers? I wonder if non-200 responses should have any special handling applied on top of the underlying cache-control headers from the upstream API

@bertday
Copy link
Author

bertday commented Mar 29, 2017

@themightychris the only control header on the upstream response was max-age=3600. Is there a best practice around that we should be using (i.e. that will change the behavior in Gatekeeper)?

@themightychris
Copy link
Member

@rbrtmrtn Gatekeeper caches according to upstream caching headers. Best practice on what those should be for non-200 responses is debatable. It seems reasonable that 404s should be cached the same as 200s, but anything else is less obvious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants