Coder Social home page Coder Social logo

Comments (8)

ryanschneider avatar ryanschneider commented on May 24, 2024

Testing some more, I think cache does need to remove the Surrogate-Control header, since if proxy removes it the cache doesn't see it.

from caddy-cache.

nicolasazrak avatar nicolasazrak commented on May 24, 2024

To be honest I didn't knew it existed. It shouldn't be hard to implement, it's just a change in the rules logic (https://github.com/nicolasazrak/caddy-cache/blob/master/rules.go). I don't have much time right now but I'll try to implement it in a few days if I can.

from caddy-cache.

ryanschneider avatar ryanschneider commented on May 24, 2024

from caddy-cache.

ryanschneider avatar ryanschneider commented on May 24, 2024

I finally spent some time looking at this more, and realized it actually needs to be added to the cachecontrol package upstream, so I'll open an issue there and see if I can add it.

from caddy-cache.

pquerna avatar pquerna commented on May 24, 2024

(upstream package here)

BTW, I'm generally fine adding support for this in cachecontrol, but as someone who has been doing http caching for a long time, I wasn't familiar with Surrogate-Control. Its not supported by nginx/apache/etc.

So, I'm not opposed to supporting it, I was just wondering if there is a real world origin you are trying to support that outputs these?

Yes, I see that varnish & fastly have been promoting more use of it, but besides a 2001 w3c note, it is notability absent from things like rfc7234

I wonder if @mnot has commentary about Surrogate-Control?

from caddy-cache.

ryanschneider avatar ryanschneider commented on May 24, 2024

Our in-house origin does, because we added it for our CDN, which I'm now looking to replace with our own edge servers, and was building a proof of concept with Caddy.

It is nice in that it's not passed to end-user browsers, so you can have separate CDN and end-user caching strategies, but I agree 100% it's pretty niche.

from caddy-cache.

nicolasazrak avatar nicolasazrak commented on May 24, 2024

I'm in favor of adding any feature as long as it doesn't add complexity to the project, which seems to be the case. For this package, I think it's just a matter of upgrading the cache-control version when the support for Surrogate-Control is implemented and removing the header from the response if it's present. So unless I'm missing something this should be a pretty trivial change.

from caddy-cache.

mnot avatar mnot commented on May 24, 2024

It's also supported by Akamai and other CDNs. That is not one of my favourite specs (sorry), but it does see deployment.

I'm half-tempted to write an updated spec and come up with some tests.

It would be good for frameworks to support it, so that they can interop with CDNs better; I've been trying to get CDNs to become more standardised in how they handle HTTP, so this would help (I think).

from caddy-cache.

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.