This should improve performance: scheduled feed updates now don't parse and attempt to save entries which we know are already in the database, because the response is cached and there are no new entries.
There are two possible ways that a cached response may still be valid:
- the response has headers that indicate it will be valid until a certain time in the future ("fresh"). In this case the feed server is not called, we already know the response is valid.
- the response does not have headers indicating that it is still valid ("stale"). However it does include conditional GET headers (last-modified, etag). Those headers are sent to the feed server and an HTTP 304 is returned ("valid").
The determination of whether the cache is "fresh" or "valid" is made looking at the X-Rack-Cache HTTP header. Rack-cache writes in this header the trace of cache operations it performs on the response.
↧