<div dir="ltr">
<div><div><p>Hi there,</p><p>I recently hit an issue where I was using 
Terraform through an HTTP proxy (enforced by my company IT) to provision
 some resources in an Openstack cloud. Since creating the resources took
 some 
time, the initial response from openstack was "still creating...". 
Further polling of the resource status resulted in receiving *cached*
copies of "still creating..." from the proxy until time-out.<br></p><p>RFC7234 that describes HTTP caching states that in absence of all headers describing the lifetime/validity of the 
response, heuristic algorithms may be applied by caches to guesstimate 
an appropriate value for the validity of the response... (Who knows what 
is implemented out there...) See: <a href="https://tools.ietf.org/html/rfc7234#section-4.2.2" rel="nofollow" target="_blank">the HTTP caching RFC section 4.2.2</a>.<br></p><p>The
 API responses describe the current state of an object which isn't 
permanent, but has a limited validity. In fact very limited as the state
 of an object might change any moment. <br></p><p>Therefore it is my 
opinion that the 
Openstack API (Nova in this case, but equally valid for all other APIs) 
should be responsible to include proper HTTP headers in their responses 
to either disallow caching of the response or at least limit it's 
validity.<br></p><p>See <a href="https://tools.ietf.org/html/rfc7234#section-5" rel="nofollow" target="_blank">the HTTP caching RFC section 5</a> for headers that could be used to accomplish that.<br></p>For sake of completeness; also see <a href="https://github.com/gophercloud/gophercloud/issues/727" target="_blank">https://github.com/gophercloud<wbr>/gophercloud/issues/727</a> for my initial client-side fix and related discussion with client-side project owners...<br><br></div>Regards,<br></div>Fred 



</div>