I fixed a max-age
to 30 seconds
on the following request of my api : GET /info
When I do the following command curl -X GET http://localhost:8080/v1/info
, I get the expected output:
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Cache-Control: max-age=30
< Content-Type: application/json; charset=utf-8
< Content-Length: 1461
< ETag: W/"5b5-3784247786"
< Date: Thu, 10 Dec 2015 09:18:08 GMT
< Connection: keep-alive
But the weird thing is that when I do another request (curl -X GET http://localhost:8080/v1/info
again)
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: application/json; charset=utf-8
< Content-Length: 1461
< ETag: W/"5b5-3784247786"
< Date: Thu, 10 Dec 2015 09:18:11 GMT
< Connection: keep-alive
The max-age header dissapear.
I tried that on 2 different virtual machines, and on the other one I get my cache-control
header sent back each time, so it works as expected.
The curl
version (curl 7.19.7
) is the same on both server.