Which of the following directive of Cache Control Header of HTTP respo...
Answer: b
Explanation: Private directive indicates that resource is cachable by only client and server, no intermediary can cache the resource.
View all questions of this test
Which of the following directive of Cache Control Header of HTTP respo...
Private
The 'Private' directive of the Cache Control Header in an HTTP response indicates that the resource is cachable by only the client and server. This means that intermediate proxies, such as caching servers, are not allowed to cache the response.
Cache Control Header
The Cache Control Header is used in HTTP responses to specify caching directives for the resource being requested. It provides instructions to the client and intermediate caches on how to handle the response and cache the resource.
Directives in Cache Control Header
The Cache Control Header can include various directives to control caching behavior. Some commonly used directives include:
- 'Public': Indicates that the resource can be cached by any cache, including the client, server, and intermediate proxies.
- 'Private': Indicates that the resource is cachable by only the client and server, and should not be cached by intermediate proxies.
- 'No-cache': Indicates that the resource should not be served from cache without first revalidating it with the server.
- 'No-store': Indicates that the resource should not be stored in any cache, including the client, server, and intermediate proxies.
- 'Max-age': Specifies the maximum amount of time in seconds that the resource can be cached before it is considered stale.
Explanation of 'Private' Directive
The 'Private' directive is used when the resource contains sensitive or user-specific information that should not be cached by intermediate proxies. This directive ensures that the response is only cached by the client and server, preventing any potential privacy or security issues.
When the 'Private' directive is included in the Cache Control Header of an HTTP response, it instructs intermediate caches not to store a cached copy of the resource. Instead, the response is delivered directly to the client and stored in the client's cache if needed. This allows the client to re-use the cached response for subsequent requests without relying on intermediate caches.
By using the 'Private' directive, the server can have more control over the caching behavior of sensitive resources and ensure that they are not inadvertently cached by intermediate proxies. This directive helps in maintaining the privacy and security of the transmitted data.