curl -i and curl -I returning different results curl -i and curl -I returning different results curl curl

curl -i and curl -I returning different results


curl sends different HTTP requests to the server (or Varnish in this case) when you use the -I option. Normally, curl will send a GET request, but when you specify -I, it sends HEAD instead (essentially telling the server to just send the header, not the actual content). I'm not particularly familiar with Varnish, but it appears to normally cache both GET and HEAD requests -- but in your case it might be configured to do something different, or the backend server may be triggering a difference... In any case, I'm pretty sure it's GET vs. HEAD that's making the cache respond differently with -i vs. -I.


got same thing when querying jenkins blueocean rest api - -i showed HTTP 200, whereas -I showed HTTP 404... same url in both cases of course