Add Vary + s-maxage to CacheControl directive for efficient CDN caching
As discussed with @tobias-tengler this is what I would want from the caching.
I will add some comments with questions on how to best solve some problems
@tobias-tengler I rebased this PR on main, as I think the old target branch got stale? Have you had the chance to have a look at this PR? Thanks!
HotChocolate.AspNetCore.Subscriptions.GraphQLOverWebSocket.WebSocketProtocolTests.Send_Pong_With_Payload [FAIL]
Codecov Report
Patch coverage: 82.07% and project coverage change: +0.32% :tada:
Comparison is base (
41c82e1) 79.00% compared to head (0d8499d) 79.33%. Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #6047 +/- ##
==========================================
+ Coverage 79.00% 79.33% +0.32%
==========================================
Files 2915 2915
Lines 140092 140092
==========================================
+ Hits 110681 111138 +457
+ Misses 29411 28954 -457
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 79.33% <82.07%> (+0.32%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files Changed | Coverage Δ | |
|---|---|---|
| ...olate/Caching/src/Caching/CacheControlAttribute.cs | 86.95% <50.00%> (ø) |
|
| ...ons/CacheControlObjectFieldDescriptorExtensions.cs | 71.42% <60.00%> (ø) |
|
| ...s/CacheControlInterfaceTypeDescriptorExtensions.cs | 35.71% <66.66%> (ø) |
|
| ...ions/CacheControlObjectTypeDescriptorExtensions.cs | 35.71% <66.66%> (ø) |
|
| ...sions/CacheControlUnionTypeDescriptorExtensions.cs | 71.42% <66.66%> (ø) |
|
| ...ng/src/Caching/CacheControlConstraintsOptimizer.cs | 80.00% <77.41%> (ø) |
|
| ...Core/Serialization/DefaultHttpResponseFormatter.cs | 73.80% <83.33%> (-20.24%) |
:arrow_down: |
| ...c/Caching/CacheControlValidationTypeInterceptor.cs | 100.00% <100.00%> (ø) |
|
| ...rc/HotChocolate/Caching/src/Caching/ErrorHelper.cs | 100.00% <100.00%> (ø) |
|
| ...ching/Properties/CacheControlResources.Designer.cs | 75.43% <100.00%> (ø) |
|
| ... and 3 more |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@tobias-tengler is there still interest in this? I could rebase/merge master but we since implemented this in our application side. Happy to help move this to HC if there is value in it though.
I suppose #7054 needs to be fixed first anyhow. That one is BTW blocking us from upgrading past HC 13.8.
@rickardp I will check with the team this week what the status is on this ... sorry for the delay here.
Thank you for fixing #7054! Happy to rebase this if there is interest in it
Can you rebase it ... V14 is essentially done and we want to take this in for 15 .... so if you rebase it to the current main we can start integrating this. Sorry that this took so long on our side but with shifting priorities sometimes you loose the focus on a PR.
I changed this to a draft for now.
@michaelstaib Updated this PR and added a few more clarifying unit tests
This looks good ... I will go over your comments ones more and verify things within the code and then its good to go. Sorry again for the long wait and thank you for your contribution.







