graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Add Vary + s-maxage to CacheControl directive for efficient CDN caching

Open rickardp opened this issue 2 years ago • 4 comments

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

rickardp avatar Apr 12 '23 17:04 rickardp

@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!

rickardp avatar Sep 08 '23 11:09 rickardp

HotChocolate.AspNetCore.Subscriptions.GraphQLOverWebSocket.WebSocketProtocolTests.Send_Pong_With_Payload [FAIL]

github-actions[bot] avatar Sep 08 '23 11:09 github-actions[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Sep 08 '23 12:09 sonarqubecloud[bot]

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

... and 201 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.

:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 08 '23 12:09 codecov[bot]

@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 avatar Sep 05 '24 07:09 rickardp

@rickardp I will check with the team this week what the status is on this ... sorry for the delay here.

michaelstaib avatar Sep 14 '24 00:09 michaelstaib

Thank you for fixing #7054! Happy to rebase this if there is interest in it

rickardp avatar Sep 18 '24 11:09 rickardp

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.

michaelstaib avatar Sep 23 '24 08:09 michaelstaib

I changed this to a draft for now.

michaelstaib avatar Sep 23 '24 08:09 michaelstaib

@michaelstaib Updated this PR and added a few more clarifying unit tests

rickardp avatar Sep 24 '24 21:09 rickardp

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.

michaelstaib avatar Sep 25 '24 08:09 michaelstaib