Open In App

HTTP headers | Pragma

Last Updated : 28 Nov, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
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. Syntax
Pragma: no-cache
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. Example:
Pragma: no-cache
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

Next Article

Similar Reads