http-cache icon indicating copy to clipboard operation
http-cache copied to clipboard

Does not work with axum Path extractor

Open enricoschaaf opened this issue 1 month ago • 1 comments

Hi 👋🏽

I am using http-cache-tower@=1.0.0-alpha.2 it breaks the axum path extractor. The first request of the server still works the next request errors with "No paths parameters found for matched route" for the same route. If I disable the cache layer its all good again. The axum comment for this error is

/// Rejection type used if axum's internal representation of path parameters /// is missing. This is commonly caused by extracting Request<_>. Path /// must be extracted first.

I am tested this both on axum 0.8.4 and 0.8.6.

Let me know if you need more info or a minimial representation.

Thanks for the lib!

Enrico

enricoschaaf avatar Oct 30 '25 14:10 enricoschaaf

An example would be helpful as I'm not sure how this would fit in with Axum from a server side perspective, I've really only ever used this from the client side.

06chaynes avatar Oct 30 '25 21:10 06chaynes

I am going to look into what it might take to create a server side crate to address this use case

06chaynes avatar Nov 18 '25 02:11 06chaynes

@enricoschaaf I just published the initial version of the tower server crate https://crates.io/crates/http-cache-tower-server

I included a couple of Axum based examples, hopefully they make sense. I am very curious to see if this works out so please let me know if you have any issues or questions

06chaynes avatar Nov 23 '25 01:11 06chaynes