Coder Social home page Coder Social logo

Comments (6)

Kevinrob avatar Kevinrob commented on May 19, 2024

Yes, this can be a good feature!

from guzzle-cache-middleware.

bpolaszek avatar bpolaszek commented on May 19, 2024

Hey there,

I know I'm 1 year late on that topic but I did not notice it before.

I'm really against the fact that the library modifies request objects (even if they're immutable). That's what the DelegatingCacheStrategy was designed for (changing strategy based on the request). It's a little more complex to use to achieve the same goal, but I'd have worked on improving this before having no other choice to touch on request objects.

Just saying 😺

from guzzle-cache-middleware.

Kevinrob avatar Kevinrob commented on May 19, 2024

@bpolaszek But we don't modifies request objects, do we?

from guzzle-cache-middleware.

bpolaszek avatar bpolaszek commented on May 19, 2024

Technically you don't, because PSR-7 objects are immutable, but my point is that you delegate to the Request object the responsibility to carry an information which is out of its scope. Nothing really important here, just quibbling with OOP 😄

from guzzle-cache-middleware.

bpolaszek avatar bpolaszek commented on May 19, 2024

Another solution would have been to fake a real Cache-Control header, which would have behaved the same.

from guzzle-cache-middleware.

Kevinrob avatar Kevinrob commented on May 19, 2024

Okay, I understand your point! It's true.
Both methods are possible with this. 😄

from guzzle-cache-middleware.

Related Issues (20)

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.