Closed ip2k closed 8 years ago
@ip2k: I believe this behaviour is actually correct. Cache-Control: no-cache
in the request asks the server to provide an uncached response, which it does (as mentioned by X-Rack-Cache: reload
).
The Cache-Control: public
in the response specifies that the client may cache the response.
In other words, the fact you asked for your data not to come from the cache has no bearing on whether the response will be cached, or can be cached.
Unless I'm missing something or misreading RFC2616?
sounds good to me ... thx for digging into the RFCs ... I know it's dirty work :D
When I
in my Sinatra app and send it a request like:
curl -vvv 'http://127.0.0.1:4567/foo' -H 'Cache-Control: no-cache' -o /dev/null
it responds with
Cache-Control: public, max-age=300
andX-Rack-Cache: reload, store
.I've hacked around this by doing:
which responds with no
Cache-Control
header, andX-Rack-Cache: reload
, which is what I would think should happen without my hack. It might be also nice to have an option to NOT store responses when a request specifiesCache-Control: no-cache
Thanks!