Replace RFC 2616 links [ci-skip]

The w3.org RFC 2616 page displays an obtrusive "This document has been
superseded" overlay.  In regard to the `Cache-Control` header, RFC 2616
has been superseded by RFC 7234, which, in turn, has been superseded by
RFC 9111.

Therefore, this commit replaces links to RFC 2616 with links to either
MDN or RFC 9111.
This commit is contained in:
Jonathan Hefner 2023-01-04 14:53:14 -06:00
parent 70a67b9ddc
commit 9a82d9585c
3 changed files with 11 additions and 10 deletions

View File

@ -58,7 +58,8 @@ module ActionController
# * <tt>:public</tt> By default the +Cache-Control+ header is private. Set this to
# +true+ if you want your application to be cacheable by other devices (proxy caches).
# * <tt>:cache_control</tt> When given, will overwrite an existing +Cache-Control+ header.
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
# For a list of +Cache-Control+ directives, see the {article on
# MDN}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control].
# * <tt>:template</tt> By default, the template digest for the current
# controller/action is included in ETags. If the action renders a
# different template, you can include its digest instead. If the action
@ -161,7 +162,8 @@ module ActionController
# * <tt>:public</tt> By default the +Cache-Control+ header is private. Set this to
# +true+ if you want your application to be cacheable by other devices (proxy caches).
# * <tt>:cache_control</tt> When given, will overwrite an existing +Cache-Control+ header.
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
# For a list of +Cache-Control+ directives, see the {article on
# MDN}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control].
# * <tt>:template</tt> By default, the template digest for the current
# controller/action is included in ETags. If the action renders a
# different template, you can include its digest instead. If the action
@ -259,7 +261,6 @@ module ActionController
# expires_in 3.hours, public: true, must_revalidate: true
#
# This method will overwrite an existing +Cache-Control+ header.
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
#
# HTTP +Cache-Control+ Extensions for Stale Content. See https://tools.ietf.org/html/rfc5861.
# It helps to cache an asset and serve it while is being revalidated and/or returning with an error.

View File

@ -55,16 +55,16 @@ module ActionController # :nodoc:
#
# send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404
#
# Read about the other <tt>Content-*</tt> HTTP headers if you'd like to
# provide the user with more information (such as +Content-Description+) in
# https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11.
# You can use other <tt>Content-*</tt> HTTP headers to provide additional
# information to the client. See MDN for a
# {list of HTTP headers}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers].
#
# Also be aware that the document may be cached by proxies and browsers.
# The +Pragma+ and +Cache-Control+ headers declare how the file may be cached
# by intermediaries. They default to require clients to validate with
# the server before releasing cached responses. See
# https://www.mnot.net/cache_docs/ for an overview of web caching and
# https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
# {RFC 9111}[https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control]
# for the +Cache-Control+ header spec.
def send_file(path, options = {}) # :doc:
raise MissingFile, "Cannot read file #{path}" unless File.file?(path) && File.readable?(path)

View File

@ -975,9 +975,7 @@ such as `X-Cache` or for any additional headers they may add.
##### CDNs and the Cache-Control Header
The [cache control
header](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) is a W3C
specification that describes how a request can be cached. When no CDN is used, a
The [`Cache-Control`][] header describes how a request can be cached. When no CDN is used, a
browser will use this information to cache contents. This is very helpful for
assets that are not modified so that a browser does not need to re-download a
website's CSS or JavaScript on every request. Generally we want our Rails server
@ -999,6 +997,8 @@ asset for up to a year. Since most CDNs also cache headers of the request, this
The browser then knows that it can store this asset for a very long time before
needing to re-request it.
[`Cache-Control`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
##### CDNs and URL-based Cache Invalidation
Most CDNs will cache contents of an asset based on the complete URL. This means