Pragma HTTP Header: Syntax, Directive, Examples

The Pragma HTTP Header HTTP/1.0 general-header is an implementation-specific header that can have a number of different impacts along the request-response chain. This header ensures compatibility with HTTP/1.0 caches that lack a Cache-Control HTTP/1.1 header. The Cache-Control HTTP header field contains directives (instructions) that control caching in browsers and shared caches in both requests and responses (e.g. Proxies, CDNs).  Because the Pragma HTTP Header is not specified for HTTP responses, it is ineffective as a replacement for the general HTTP/1.1 Cache-Control header, despite the fact that it has the same behavior as Cache-Control, no-cache, if the Cache-Control header field is omitted in a request Pragma, should only be used for backward compatibility with HTTP/1.0 clients. There is only one value using the Pragma HTTP Header. The value using the Pragma  HTTP Header is the no-cache. An example of the Pragma HTTP Header is written below. 

content-type: application/binary
date: Mon, 22 Mar 2015 07:35:26 GMT
expires: Mon, 01 Jan 1990 00:00:00 GMT
location: https://analytics.google,com/analytics/web/
pragma: no-cache
server: ESF
set-cookie: SIDC=jGbjhtgdsvbakzmRTFjhds jGVs
RNPoA; expires= Thu, 29-Feb-2020 07:23:25 GMT; path=/; domain=,google.com; priority=high

The Pragma HTTP Header Request and Response Header can be seen above. In this article, the Pragma HTTP Header Syntax, Directives and Uses examples will be processed. 

What is Pragma HTTP Header?

The Pragma HTTP Header is a no-cache general-type CORS-safe listed response header field in an HTTP/1.0 header meant to be used in the request-response chain. A Pragma HTTP Header is used to prevent the client from caching the response. The Pragma HTTP Header tells browsers to tell the server and any intermediate caches that they want a fresh version of the resource, which is not true.

What is the Syntax of Pragma HTTP Header?

The Pragma HTTP Header uses only one value. The syntax for using the Pragma HTTP Header is written below. 

Pragma: no-cache

What is the Directive of Pragma HTTP Header?

The Pragma HTTP Header can only contain one directive. The no-cache is the same as “Cache-Control: no-cache”. Caches are required to submit the request to the origin server for validation prior to releasing a cached copy. An example directive for using the Pragma HTTP Header is given below. 

Pragma: no-cache

How to use Pragma HTTP Header?

In an HTTP/1.0 header, the Pragma HTTP Header is a no-cache general-type CORS-safe listed response header field that is intended to be used in the request-response chain. A pragma header is used to prevent the client from caching the answer. It tells the server and any intermediate caches that the browser needs a fresh version of the resource and vice versa.

Examples of Pragma HTTP Header Use

To see the Pragma in action, go to Inspect Element -> Network and look for Pragma in the header, as seen below. The header of the Pragma is emphasized.

content-type: application/binary
date: Mon, 12 Sep 2015 07:35:26 GMT
expires: Mon, 11 Jun 1990 00:00:00 GMT
location: https://analytics.google,com/analytics/web/
pragma: no-cache
server: ESF
set-cookie: SIDC=jGbjhtgdsvbakzmRTFjhds jGVs
RNPoA; expires= Thu, 29-Feb-2020 07:23:25 GMT; path=/; domain=,google.com; priority=high

What is the Specification Document for Pragma HTTP Header?

There is only one specification document for the Pragma HTTP Header which is the RFC 7234. The RFC 7234 Hypertext Transfer Protocol (HTTP/1.1): Caching (HTTP/1.1 Caching) Article 5.4. mention the Pragma HTTP Header definition and uses. Additionally, this article discusses the Pragma HTTP Header’s values and examples.

What are the types of Pragma HTTP Header?

The Pragma HTTP Header HTTP Type is listed below.

  1. The HTTP Header type of the Pragma HTTP Header is Response Header type because it’s a field in an HTTP/1.0 header meant to be used in the request-response chain.
  2. The HTTP Header type of the Pragma HTTP Header is Request Header type Because it was designed to prevent the client from caching the answer, pragma requires browsers to inform the server and any intermediate caches that they want a new version of the resource, rather than the other way around.

What are the similar HTTP Headers to the Pragma HTTP Header?

There are other similar HTTP to the Pragma HTTP Header. The examples are listed below. 

  • Cache-Control HTTP Header: When you send a request or a response, the Cache-Control HTTP header field holds directives or instructions that control how long things are stored in browsers and other shared caches, like proxies and CDNs. This is similar to the Pragma HTTP Header, which has a wide range of effects on the request and response chain, as well.
  • Expires HTTP Header: The Expires HTTP header tells you when the response is no longer valid, like the Pragma HTTP Header, which also tells you the date and time.

Which Browsers Support Pragma HTTP Header? 

There are multiple browsers that support Pragma HTTP Header. The following browsers are listed below.

  • Chrome Browser is compatible with the Pragma HTTP Header.
  • Edge Browser is compatible with the Pragma HTTP Header.
  • Firefox Browser is compatible with the Pragma HTTP Header.
  • Internet Explorer Browser is compatible with the Pragma HTTP Header.
  • Opera Browser is compatible with the Pragma HTTP Header.
  • Safari Browser is compatible with the Pragma HTTP Header.
  • WebView Android Browser is compatible with the Pragma HTTP Header.
  • Chrome Android Browser is compatible with the Pragma HTTP Header.
  • Firefox for Android Browser is compatible with the Pragma HTTP Header.
  • Opera Android Browser is compatible with the Pragma HTTP Header.
  • Safari on iOS Browser is compatible with the Pragma HTTP Header.
  • Samsung Internet Browser is compatible with the Pragma HTTP Header.

You can see an image that shows cross-browsers compatibility of Pragma HTTP Headers below.

Pragma HTTP Header
Holistic SEO
Follow SEO

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.