ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.27k stars 748 forks source link

Schema endpoint in v14 returns same etag #7760

Closed sergiu-enache closed 4 days ago

sergiu-enache commented 5 days ago

Product

Hot Chocolate

Version

14.1.0

Link to minimal reproduction

repro-uploaded-as-zip

Steps to reproduce

Since v14 the schema endpoint has cache-control.

Even if the schema changes, the /sdl endpoint returns same etag.

Image

After I change the schema (commented out person.shortName)

Image

I get same ETAG and cached schema by browser.

I've uploaded a .zip repro project. schema-endopoint-etag-issue.zip

What is expected?

After changing schema and using browser to get /graphql/sdl latest schema should be downloaded.

What is actually happening?

After changing schema and using browser to get /graphql/sdl latest previous schema with same ETAG is downloaded.

Relevant log output

Additional context

No response

michaelstaib commented 4 days ago

I have tested this with your repro and I get for each change a new etag...

Original "1-FulXWMljqt/Ts2ffo0GwgfOgzNl4yGD37d0mRZHWxGo="

After uncommenting public string? ShortName { get; } "1-0rV9c6+YAlBB75JufhVV8z4yLRgFgPJvgoY7g+rJv1k="

I have verified this with postman.

sergiu-enache commented 4 days ago

I'll try again..

sergiu-enache commented 4 days ago

@michaelstaib I tried with Chrome, Edge and Postman

Originals 1-582d8s3vNNey3e2mF6xrFnCR3s63YYKs18c+QUor/tg= 1-582d8s3vNNey3e2mF6xrFnCR3s63YYKs18c+QUor/tg= 1-582d8s3vNNey3e2mF6xrFnCR3s63YYKs18c+QUor/tg=

After uncommemting public string? ShortName { get; } 1-582d8s3vNNey3e2mF6xrFnCR3s63YYKs18c+QUor/tg= 1-582d8s3vNNey3e2mF6xrFnCR3s63YYKs18c+QUor/tg= 1-ngiJaIjjSLFgRcTDLS/PBgImr96gPHmI4jIFv85qNeI=

Only with Postman it returns new tag.

Any thoughts?

michaelstaib commented 4 days ago

With chrome you get probably the cached result

sergiu-enache commented 4 days ago

I think the problem might be with returning 'must-revalidate'

EDIT: max-age=0, must-revalidate and no-cache are identical