graphite-project/graphite-web — pull request #978 by aroben (2014-10-01 21:19:24+00:00)
Title: Make HTTP clients only cache graphs as long as we keep them in memcached

We were previously setting `Cache-Control: no-cache` and `Pragma: no-cache` without setting any `Expires` or `Last-Modified` headers. This was causing some clients (e.g., WebKit on iOS) to cache images indefinitely.

We now set `Expires`, `Last-Modified`, and `Cache-Control: max-age` to tell clients to cache images for as long as we cache them in memcached. If we aren't using memcached, we tell clients not to cache the images at all.