Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the HTTP header Pragma: Public mean?

Tags:

http

pragma

What does the HTTP header Pragma: Public mean?

like image 894
user185631 Avatar asked Dec 17 '09 10:12

user185631


People also ask

What is Pragma HTTP header?

The Pragma HTTP/1.0 general header is an implementation-specific header that may have various effects along the request-response chain. This header serves for backwards compatibility with the HTTP/1.0 caches that do not have a Cache-Control HTTP/1.1 header.

How do you get a Pragma header?

To check the Pragma in action go to Inspect Element -> Network check the header for Pragma like below. Pragma header is highlighted.

What does pragma no-cache mean?

"The Pragma: no-cache header field is an HTTP/1.0 header intended for use in requests. It is a means for the browser to tell the server and any intermediate caches that it wants a fresh version of the resource, not for the server to tell the browser not to cache the resource.

What is cache-control public?

Cache-control is an HTTP header used to specify browser caching policies in both client requests and server responses. Policies include how a resource is cached, where it's cached and its maximum age before expiring (i.e., time to live).


2 Answers

According to the standard, Pragma is implementation dependent (section 14.32), except for no-cache because of its wide use. Cache-Control (section 14.9) is the proper way to control caching. This is what the standard says for a Cache-Control: public:

Indicates that the response MAY be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache.

like image 102
Gonzalo Avatar answered Sep 20 '22 10:09

Gonzalo


Also, "Pragma: Public" is used in Google App Engine applications to enable caching of responses within its Edge Cache.

See Details on Google App Engine's caching proxy?

like image 25
Andy Dennie Avatar answered Sep 20 '22 10:09

Andy Dennie