In modern graphical applications, a good user experience is clearly dependent upon great design and a high level of quality, but it's also important to handle network and service failures. In the Network resources and caching section of this chapter, we covered, caching of server responses to be more fault tolerant and to speed up application loading, but that's a small portion of a larger strategy for great offline support.
The response caching code introduced earlier in this chapter can be applied to almost all HTTP requests, but we only used it for HTTP GET. Of the many different types of HTTP requests, only three are deemed to be cacheable (GET, HEAD, and POST), and the HEAD request doesn't return a body and so isn't useful in our application. The POST method is indicative of an action being performed, so in our context (and most others), it's more important to know that it completed, rather than to save the response it caused ...