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

Allow configuration of which HTTP methods to cache and replay. #6

Merged
merged 1 commit into from Aug 22, 2022

Conversation

PatrickGleeson
Copy link
Collaborator

In non-RESTful applications, it is useful to allow caching additional HTTP methods beyond POST and PATCH. This pull request allows passing a list of HTTP method names for which caching and replaying will be enabled.

@sondrelg
Copy link
Member

Nice. Just so I understand; the use for this would be if you, e.g., have a PUT endpoint that has side-effects, and you want to expand caching to cover this entire category of endpoints?

@PatrickGleeson
Copy link
Collaborator Author

Exactly. And by making it configurable, it's easy to set up and allows for other choices (no caching on PATCH for example).

@sondrelg
Copy link
Member

Makes sense to me 👍

I originally wrote this middleware, hoping to use it in a project at work, but realised we probably wouldn't find a reason to use it after all, so haven't really put any time into it since the first couple of commits. If you want though, I guess I can update all the workflows, move this into the snok org., and release a v0.2.0 with these changes.

If you're interested in helping maintain this, let me know and I'll invite your to the project 🙂

@sondrelg
Copy link
Member

Quick question: what backend are you planning to use, and are you relying on aioredis in any way? We've migrated all our projects away from aioredis after redis merged in the relevant async functionality.

If not, I'll remove the aioredis stuff in favour of redis 👍

@PatrickGleeson
Copy link
Collaborator Author

Planning on using a redis backend, but not relying on aioredis atm. Migrate away. 👍

@sondrelg sondrelg merged commit a4529a5 into snok:main Aug 22, 2022
@sondrelg
Copy link
Member

sondrelg commented Aug 22, 2022

Sorry for the delay. Don't think I'll be able to spend any time on this for at least a few more days, but intend to do so eventually. In the meantime, PRs are welcome 👍 Thanks for this one 🙂

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 this pull request may close these issues.

None yet

2 participants