0

I wanted to know why standard HTTP/1.1 header fields define Cache-Control as directives ? and other header fields not marked as same.

I went though the all standard HTTP/1.1 header fields [https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html] definition it only apply with Cache-Control general-header field except Pragma general-header field where I also does not have idea.

Prageeth godage
  • 4,054
  • 3
  • 29
  • 45

1 Answers1

1

Well for a start RFC 2616 has been superseded by RFC 7234

At a guess I would say they are “directives” as they MUST be obeyed, as opposed to other headers which do not define any specific behaviour.

The original HTTP/1.1 RFC 2616 has this to say, over which I have highlighted some relevant phrases:

13.1.3 Cache-control Mechanisms

The basic cache mechanisms in HTTP/1.1 (server-specified expiration times and validators) are implicit directives to caches. In some cases, a server or client might need to provide explicit directives to the HTTP caches. We use the Cache-Control header for this purpose.

The Cache-Control header allows a client or server to transmit a variety of directives in either requests or responses. These directives typically override the default caching algorithms.

Community
  • 1
  • 1
Barry Pollard
  • 40,655
  • 7
  • 76
  • 92