Skip to content

Conversation

@aleasims
Copy link
Contributor

@aleasims aleasims commented Apr 12, 2025

I'm creating this PR just to show some ideas. The code here is pretty ugly and should not be merged as is.

The main goal was to do some experiments with HttpResponse::body type - make it generic and see what happens.

Basically changes are:

  • HttpResponse is now HttpResponse<T = Vec<u8>>
  • CacheManager is now CacheManager<R = Vec<u8>>

I another impl to CACacheManager: CacheManager<cacache::Reader> which doesn't read the whole body of HTTP response into memory at once. However now when I'm looking at it I think I messed up here cause I don't see a clear way to use cacache::Reader for user as an input. Probably some additional interface inside http-cache itself is needed here.

I don't see any way to achieve this without breaking changes though - and this is probably concerning,

Again this is just WIP on some ideas, not a ready-to-go code suggestion.

@06chaynes
Copy link
Owner

I noticed this crate http-cache-stream a bit ago after publishing some updates, looks neat and sounds like it might accomplish what you were looking for here. I would still like to be able to support similar functionality but in the meantime this might be worth trying out!

@06chaynes
Copy link
Owner

Closing this in favor of the streaming logic added in PR #115

@06chaynes 06chaynes closed this Jul 28, 2025
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.

2 participants