Repository: vapor/vapor
File: Sources/Vapor/HTTP/HTTPHeaderCacheControl.swift (Swift)

Code before:
import NIO

// Comments on these properties are copied from the mozilla doc URL shown below.
extension HTTPHeaders {
    /// Represents the HTTP `Cache-Control` header.
    /// - See Also:
    /// [Cache-Control docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
    public struct CacheControl {
        /// The max-stale option can be present with no value, or be present with a number of seconds.  By using
        /// a struct you can check the nullability of the `maxStale` variable as well as then check the nullability
        /// of the `seconds` to differentiate.
        public struct MaxStale {
            /// The upper limit of staleness the client will accept.
            public var seconds: Int?
        }

        /// Indicates that once a resource becomes stale, caches must not use their stale copy without
        /// successful [validation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Cache_validation) on the origin server.
        public var mustRevalidate = false

        /// Caches must check with the origin server for
        /// [validation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Cache_validation) before using the cached copy.
        public var noCache = false

        /// The cache **should not store anything** about the client request or server response.
        public var noStore = false

        /// No transformations or conversions should be made to the resource. The Content-Encoding, Content-Range, Content-Type headers must not be modified
        /// by a proxy. A non-transparent proxy or browser feature such as
        /// [Google's Light Mode](https://support.google.com/webmasters/answer/6211428?hl=en) might, for example, convert between image
        /// formats in order to save cache space or to reduce the amount of traffic on a slow link. The `no-transform` directive disallows this.
        public var noTransform = false

        /// The response may be cached by any cache, even if the response is normally non-cacheable
        public var isPublic = false

        /// The response is for a single user and **must not** be stored by a shared cache. A private cache (like the user's browser cache) may store the response.
        public var isPrivate = false

        /// Like `must-revalidate`, but only for shared caches (e.g., proxies). Ignored by private caches.
        public var proxyRevalidate = false

        /// Indicates to not retrieve new data. This being the case, the server wishes the client to obtain a response only once and then cache. From this moment the
        /// client should keep releasing a cached copy and avoid contacting the origin-server to see if a newer copy exists.

Review comment (suggestion):
Vapor style is no defaults on member var declarations. Any defaults should be added to an explicit init method. This makes sure the init method is public. 

Code after:
import NIO

// Comments on these properties are copied from the mozilla doc URL shown below.
extension HTTPHeaders {
    /// Represents the HTTP `Cache-Control` header.
    /// - See Also:
    /// [Cache-Control docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
    public struct CacheControl {
        /// The max-stale option can be present with no value, or be present with a number of seconds.  By using
        /// a struct you can check the nullability of the `maxStale` variable as well as then check the nullability
        /// of the `seconds` to differentiate.
        public struct MaxStale {
            /// The upper limit of staleness the client will accept.
            public var seconds: Int?
        }

        /// Indicates that once a resource becomes stale, caches must not use their stale copy without
        /// successful [validation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Cache_validation) on the origin server.
        public var mustRevalidate: Bool

        /// Caches must check with the origin server for
        /// [validation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Cache_validation) before using the cached copy.
        public var noCache: Bool

        /// The cache **should not store anything** about the client request or server response.
        public var noStore: Bool

        /// No transformations or conversions should be made to the resource. The Content-Encoding, Content-Range, Content-Type headers must not be modified
        /// by a proxy. A non-transparent proxy or browser feature such as
        /// [Google's Light Mode](https://support.google.com/webmasters/answer/6211428?hl=en) might, for example, convert between image
        /// formats in order to save cache space or to reduce the amount of traffic on a slow link. The `no-transform` directive disallows this.
        public var noTransform: Bool

        /// The response may be cached by any cache, even if the response is normally non-cacheable
        public var isPublic: Bool

        /// The response is for a single user and **must not** be stored by a shared cache. A private cache (like the user's browser cache) may store the response.
        public var isPrivate: Bool

        /// Like `must-revalidate`, but only for shared caches (e.g., proxies). Ignored by private caches.
        public var proxyRevalidate: Bool

        /// Indicates to not retrieve new data. This being the case, the server wishes the client to obtain a response only once and then cache. From this moment the
        /// client should keep releasing a cached copy and avoid contacting the origin-server to see if a newer copy exists.