What is the HTTP "Pragma no-cache" header?

Posted: (EET/GMT+2)

 

The HTTP protocol version 1.0 is already a quite complex protocol, and especially with customer headers, it can be extended and configured. There's also one interesting header that is part of the standard: Pragma. I was today looking into this, and found that one option, "no-cache" is specified in the RFC.

So, if the HTTP headers contain a line like this:

Pragma: no-cache

...then it means that the client is requesting a live version of the resource, and not a version cache by a possible proxy server. Otherwise, it has no effect.

One open question remains: what if a web server receives this HTTP header and uses some kind of internal caching? Should the cached response then be discarded? I'm not sure.

Even so, if your proxy server or gateway supports this option, then you can use this header to request the latest copy of the resource. Useful for timely information, like news or other events.