Thuva Tharma | Developer @ theScore Inc. | @ttharma
The goal of caching in HTTP/1.1 is to eliminate the need to send requests in many cases, and to eliminate the need to send full responses in many other cases
> GET /thescore_logo.png
> If-Modified-Since: Tue, 10 Aug 2013 03:51:19 GMT
> If-None-Match: "5ee39d70f536014bdb599c1442d"
< 200 OK
< ...
< Cache-Control: max-age=300
< Expires: Tue, 10 Sep 2013 03:56:19 GMT
< Last-Modified: Tue, 10 Sep 2013 03:51:19 GMT
< Etag: "3bbe876fc7acb81cfe03b925fa142710"
> GET /thescore_logo.png
< 200 OK
< Cache-Control: max-age=300
< Expires: Tue, 10 Sep 2013 03:56:19 GMT
Last-Modified
Validator
> GET /thescore_logo.png
< 200 OK
< Last-Modified: Tue, 10 Sep 2013 03:51:19 GMT
> GET /thescore_logo.png
> If-Modified-Since: Tue, 10 Sep 2013 03:51:19 GMT
< 304 Not Modified
< Last-Modified: Tue, 10 Sep 2013 03:51:19 GMT
Etag
Validator
> GET /thescore_logo.png
< 200 OK
< Etag: "3bbe876fc7acb81cfe03b925fa142710"
> GET /thescore_logo.png
> If-None-Match: "3bbe876fc7acb81cfe03b925fa142710"
< 304 Not Modified
< Etag: "3bbe876fc7acb81cfe03b925fa142710"
> GET /thescore_logo.png
< 200 OK
< Cache-Control: max-age=300
< Etag: "3bbe876fc7acb81cfe03b925fa142710"
> GET /thescore_logo.png
> If-None-Match: "3bbe876fc7acb81cfe03b925fa142710"
< 304 Not Modified
< Cache-Control: max-age=300
< Etag: "3bbe876fc7acb81cfe03b925fa142710"
NSURLCache
(drop-in caching for NSURLConnection
)HttpResponseCache
(drop-in caching for HttpUrlConnection
)