Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the Valid values for http Pragma

What are the valid values for http header pragma . I know no-cache is one but i wnat to enable caching so what should i set it. I did some googleing and all that i got was most clients ignore this but no info on other values it accepts.

like image 904
aWebDeveloper Avatar asked Sep 10 '11 22:09

aWebDeveloper


2 Answers

Surprisingly there is only one parameter defined by default, which is no-cache and no new Pragma directives will be defined in HTTP as per RFC.

ref: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32

Moreover, you will need to use the Cache-Control header for managing the caching behaviors rather than the Pragma directive which seems to be still included only to support the legacy HTTP/1.0.

ref: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

Bonus: http://www.mnot.net/cache_docs/

like image 193
SparX Avatar answered Sep 20 '22 18:09

SparX


You're probably looking for Cache-Control, this is supported in HTTP/1.1 and defines more states than Pragma.

like image 40
JohnD Avatar answered Sep 23 '22 18:09

JohnD