Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[feature request] Cache-control: Immutable #97
This is a very recent feature, but one that could improve many sites performance. If there already exists a way to achieve this, it would be great to have it on the Docs.
referenced this issue
Jan 29, 2017
It's not currently documented because
Regarding the feature request: Is your request to add something to the
This middleware reads the header to determine if and how long to cache a resource. It doesn't set it.
Speaking of setting it, yes, either it's something for you to do with Static File Middleware (i.e., in
Interesting feature. This middleware is not the right place for it though, it doesn't set any headers, it only reads them. Using OnPrepareResponse sounds like your best place to implement this. Note we've previously declined requests to add other cache control options directly to the static files options, so I doubt we'd add this one as a first class option, especially before it becomes a formal spec.
Adding this option to the MVC attribute seems out of place, as MVC content is inherently dynamic. It should be pretty easy to append this value to the header in your MVC controller if you really want it. Give it a try and feel free to share the code for review.
This was referenced
Jan 30, 2017
I think the