The Pragma is a no-cache general-type CORS-safe listed response header field in an HTTP/1.0 header which is intended to use in the request-response chain. A pragma header meant to prevent the client from caching the response, pragma means the browsers to tell the server and any intermediate caches that it wants a fresh version of the resource and vice-versa is not true.
Note: Pragma is not specified for HTTP responses that’s why it is not a reliable replacement for the general HTTP/1.1 Cache-Control header. It is used only for backwards compatibility with HTTP/1.0 clients.
Difference between Pragma and Cache-control headers: The Pragma is only defined as applicable to the requests by the client, and the Cache-Control may be used by both the requests of the clients and the response of the servers.
Directives: It is same as Cache-Control: no-cache header. It forces the caches to submit the request to the origin server for validation before releasing a cached copy.
To check the Pragma in action go to Inspect Element -> Network check the header for Pragma like below. Pragma header is highlighted.
Browser Compatibility: The browsers compatible with Pragma header are listed below:
- Google chrome 6.0 and above
- Internet Explorer 9.0 and above
- Firefox 4.0 and above
- Opera 11.1 and above
- Safari 5.0 and above
- Samsung Internet
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | DNT
- HTTP headers | Tk
- HTTP headers | Alt-Svc
- HTTP headers | Allow
- HTTP headers
- HTTP headers | Via
- HTTP Headers | TE
- HTTP headers | From
- HTTP headers | Age
- HTTP headers | expires
- HTTP headers | Host
- HTTP headers | If-None-Match
- HTTP headers | X-Forwarded-For
- HTTP headers | Trailer
- HTTP headers | Set-Cookie2
- HTTP headers | Expect-CT
- HTTP headers | Server
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.