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

Caching undesired StatusCodes #169

Closed
choelzl opened this issue Jan 16, 2022 · 0 comments · Fixed by #170
Closed

Caching undesired StatusCodes #169

choelzl opened this issue Jan 16, 2022 · 0 comments · Fixed by #170

Comments

@choelzl
Copy link
Contributor

choelzl commented Jan 16, 2022

Current behaviour:
Souin caches responses with any status code, even if a service returns an error or is down (500/502).

Expected behaviour:
Some responses should not be cached as seen here : Cacheable StatusCodes ( ietf.org)

Example:

  • 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, and 501 are cached
  • 500, 502, 499, ... are not cached
@choelzl choelzl mentioned this issue Jan 16, 2022
@choelzl choelzl changed the title Caching undesired errors Caching undesired StatusCodes Jan 16, 2022
darkweak added a commit that referenced this issue Jan 17, 2022
* Check status code before caching

* Added Test for status code checks

* Update rfc/standalone.go

Co-authored-by: darkweak <darkweak@protonmail.com>

* Mirrored change into vendor packages

Co-authored-by: choelzl <cedric.hoelzl@helcel.net>
Co-authored-by: darkweak <darkweak@protonmail.com>
choelzl added a commit to choelzl/souin that referenced this issue Jan 17, 2022
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

Successfully merging a pull request may close this issue.

1 participant