Coder Social home page Coder Social logo

Comments (6)

06chaynes avatar 06chaynes commented on July 17, 2024

Yes, the request would need to be cloned so if you're dealing with a situation where that's not possible I would recommend removing the middleware for now.

from http-cache.

06chaynes avatar 06chaynes commented on July 17, 2024

Thought about this a bit more and I could possibly add a new method that would be called in the middleware implementation before the run method call to determine if the request is cacheable or not, then maybe just continue the chain normally rather than calling the run method. This would at least allow those requests determined non cachable to proceed without needing to be cloned.

from http-cache.

06chaynes avatar 06chaynes commented on July 17, 2024

@joolean not sure if you'd be interested in the details but I made a branch to test this change. Still looking things over and testing but I think it should work for your purposes in its current state. If it's determined to be a cacheable request then the logic would still run and error if a clone isn't possible, but now if it's determined to not be a cacheable request it the client implementation should run without cloning the request.

from http-cache.

06chaynes avatar 06chaynes commented on July 17, 2024

Just FYI I finished up these changes and merged this into develop, so it'll be in the next release. This still can't work with requests that can't be cloned and determined to be cacheable but now it should at least work in those situations where it's determined to not be cacheable. Hope this update helps out!

from http-cache.

joolean avatar joolean commented on July 17, 2024

Thanks for working on this @06chaynes! This sounds like it'll address my use case quite well. I've been busy with work but will try out the new release as soon as it's ready.

from http-cache.

06chaynes avatar 06chaynes commented on July 17, 2024

Sounds good! Just published the new versions so should be good to test whenever. Feel free to let me know if you have any issues!

from http-cache.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.