How can I prevent my CGI results being cached by the browser?

Firstly, we need to debunk a myth. People asking this question usually add that they tried "Pragma: no-cache". Whilst this is not actively wrong, there is no requirement on browsers to take any notice of it, and most of them don't.

The "Pragma: no-cache" header (now superseded by HTTP/1.1 Cache-Control) is a directive to proxies. The browser sends it with an HTTP request to indicate that it wants the request to be dealt with by the original server and will not accept a proxy's cached document (e.g. When you use a reload button). The server may send it to tell a proxy not to cache the document.

Having said all that, a practical hack to get round cacheing is to use a different URL for your CGI script each time it's called. This can easily be accomplished by adding a unique identifier such as current time in the QUERY_STRING or PATH_INFO. The browser will see a different URL, but the script can just ignore it.

Note that this can be very inefficient, and should be avoided where possible. More.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions