Comments (8)
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.
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.
from caddy-cache.
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.
(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.
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.
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.
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)
- Add a configuration to not use query params in cache key. HOT 2
- caddy-cache relative cache paths do not respect the root directive HOT 1
- New release? HOT 1
- How to control cached files http header? HOT 5
- How to only cache data with status 200 HOT 2
- Http: multiple response.WriteHeader calls HOT 9
- Large file request
- http2 Push Dosn't work with cache plugin HOT 1
- RFC 7234: Prefer value from Cache-Control: s-maxage HOT 1
- RFC 5861 Cache-Control Extensions for Stale Content (async cache refresh) HOT 2
- LGPL Licence HOT 6
- Memory leak HOT 4
- Cached file is deleted from /tmp dir HOT 1
- HLS M3U8 Caching HOT 1
- Static website cache HOT 1
- Caddy's import path has changed
- Header modification conflict
- Conflicts with cors plugin HOT 1
- "superfluous response.WriteHeader" and "wrote more than the declared Content-Length" HOT 1
- 'cache' directive not recognized HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caddy-cache.