Using GET instead of HEAD for command line caching tests
Last updated June 30, 2016
If you're testing on the command line to determine an object's caching status, then use GET instead of HEAD. For example:
curl -svo /dev/null www.example.com
Default caching behavior of HTTP verbs
By default, the results of GET requests are cached. HEAD requests are not proxied as is, but are handled locally if an object is in cache or a GET is done to the backend to get the object into the cache. Anything other than HEAD or GET requests are proxied and not cached by default. However, POSTs can be cached if required, and caching of that can be keyed off of the contents of the POST request body if that is below 2K. We've posted an example of how to do this.
Back to Top