badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.48k stars 5.49k forks source link

Responses are missing Vary header #5138

Open szepeviktor opened 4 years ago

szepeviktor commented 4 years ago

Description

Few HTTP headers are incorrect. https://redbot.org/?uri=https%3A%2F%2Fimg.shields.io%2Fpackagist%2Fdt%2Fszepeviktor%2Fphpstan-wordpress.svg

kép

Please consider fixing them. Thanks.

Link to the badge

https://img.shields.io/packagist/dt/szepeviktor/phpstan-wordpress.svg

paulmelnikow commented 4 years ago

Hmm, is our cache-control header missing a comma?

Cache-Control: max-age=120 s-maxage=120

Should it be…

Cache-Control: max-age=120, s-maxage=120

I'm familiar with Vary though I'm not sure what we ought to be sending for that (or if that's a problem with Cloudflare).

The __cfduid warning is a Cloudflare thing; not something we can easily fix.

szepeviktor commented 4 years ago

I think Vary: Accept-Encoding is the missing header. Try sending it.

chris48s commented 4 years ago

I've just deployed #5139 which fixes the cache-control header. Thanks for that @szepeviktor . I wonder if the vary header is also cloudflare related?

https://redbot.org/?uri=https%3A%2F%2Fimg.shields.io%2Fpackagist%2Fdt%2Fszepeviktor%2Fphpstan-wordpress.svg reports the issue with Vary, but if I run the same test on staging https://redbot.org/?uri=https%3A%2F%2Fshields-staging.herokuapp.com%2F%2Fpackagist%2Fdt%2Fszepeviktor%2Fphpstan-wordpress.svg (which bypasses cloudflare - it just serves straight from heroku), we don't get that warning.

szepeviktor commented 4 years ago

Server: Cowboy

Could it be that webserver is not able to compress responses??

Accept-Encoding: gzip

https://redbot.org/?uri=https%3A%2F%2Fshields-staging.herokuapp.com%2Fpackagist%2Fdt%2Fszepeviktor%2Fphpstan-wordpress.svg&req_hdr=Accept-Encoding%3Agzip

chris48s commented 4 years ago

Yes I think you're right :+1: Passing Accept-Encoding: gzip does nothing on staging. Are you interested in submitting a PR to add the vary header?

szepeviktor commented 4 years ago

Are you interested in submitting a PR to add the vary header?

Thank you.

I'm really deep into HTTP, but 9 on a 0-100 scale in Python.

chris48s commented 4 years ago

Sorry. I don't understand if that means yes or no :confused:

szepeviktor commented 4 years ago

a No

chris48s commented 4 years ago

No worries. I'll pick this one up