diff options
author | Patrick Toomey <ptoomey3@biasedcoin.com> | 2017-08-23 11:18:11 -0600 |
---|---|---|
committer | Patrick Toomey <ptoomey3@biasedcoin.com> | 2017-08-23 11:18:11 -0600 |
commit | 94b602055b0d6e2e1a9f6d33b49b433260f5e656 (patch) | |
tree | 8c4b8d5017b7e88d0b7f3664288fd30a65471bce /actionpack/lib/action_dispatch/http/rack_cache.rb | |
parent | 6ab35ee11bca2f73384fe9b1b570139b884630f2 (diff) | |
download | rails-94b602055b0d6e2e1a9f6d33b49b433260f5e656.tar.gz rails-94b602055b0d6e2e1a9f6d33b49b433260f5e656.tar.bz2 rails-94b602055b0d6e2e1a9f6d33b49b433260f5e656.zip |
Decouple the merge/normalization and conditional cache control logic
The prior logic was trying to do too many things at once. For all responses,
we want to perform two distinct steps:
* Merge/normalize the `Cache-Control` values found in HTTP headers and those
found in the `@cache_control` hash.
* Conditionally set a default `Cache-Control` header value when we have an ETag
This change separates these concerns since the merge/normalize step should
occur for all responses, but the second should only occur when we have already
set an ETag/last modified value. Normally ETag middleware will set a default
`Cache-Control`, but only if an existing ETag is not already set. So, in the
cases where an ETag is set, we need to set the default `Cache-Control` value
ourselves.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/rack_cache.rb')
0 files changed, 0 insertions, 0 deletions