-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
http-cache with ureq #91
Comments
When I had first looked into it some years ago ureq didn't appear to have middleware support, but I see now that has since changed. Given that it may be possible but I would need to play around with it to know for sure. If I get some free time soon I'll look into what it would take to create a ureq client library for http-cache. |
@mrchantey i noticed in the linked issue that one problem with using reqwest was the requirement of tokio. Because http-cache is an async library we will need to deal with this somehow to use with ureq. Since this library would really start off for your use case do you have any input on how this might best be handled? It's my understanding we would need to import some async runtime to do this, but maybe there's another way I'm just not aware of. Edit: to clarify this would be a requirement for the ureq http cache client library, not your code itself. But I want to check for any opinions on the matter before I attempt to throw something together. |
Good question the requests are made in a non-tokio async block, its my understanding that bevy has some custom async implementation. The first implementation used I think @aevyrie would be a good person to ask about deeper bevy async stuff if required. |
I think I might be able to use |
Made an effort to start on this but running into some lifetime problems that I think are Send/Sync related on the ureq Middleware trait. Will look into this again as I have time but if any progress is made your way I'd also be happy to accept a PR. |
Sounds good thanks for giving it a look. |
I think what this may require me to do is to revisit the refactor I had attempted a few years ago, which was originally started to better support tower and therefore hyper. I hit a blocker with the tower service and the refactor didn't go anywhere. I ran into problems when trying to implement a ureq client library with things as they currently are, and I think this refactor may get around those issues. I had pushed the code I had to the refactor branch so it wouldn't be lost but it would need some work before I could merge anything. To save time I think I will try to make the client against the refactor branch code and just see how far I get. If it does work out then I will pursue getting the refactor finished and updated with the changes that have been added in since the attempt was made. |
For the Bevy use-case Ive added a very simple cache that never invalidates, its better than nothing but id still love to work out how to integrate |
I'm working on a feature that requires the use of
ureq
as well as http caching, any tips or prior art for usinghttp-cache
with ureq?The text was updated successfully, but these errors were encountered: