phphtmldjangobrowser-cacheserver-side-includes

Do dynamic responses (PHP, Django, etc) set any sort "not static" variable in the response header?


If I have some site on a server:

//hello.html
<html> hello </html>

Would all of the following be requested and/or cached individually:

http://hello.html, http://hello.html?place=world, http://hello.html?foo=bar

...even though they are the same result?

Is there some variable in the header that denotes the difference between a static (always the same) response to a request and one which has had some meddling (ie. PHP, templates)?

EDIT: if the site was (I don't know PHP):

<html><?php
   print "hello"+$_GET['place'];;
?></html>

the results would be different for the three urls:

http://hello.html, http://hello.html?place=world, http://hello.html?foo=bar

Is the response header also changed to express that for all three the page is not static (not cacheable)?


Solution

  • This answer is based off of a comment by @CharlotteDunois. If he adds an answer, I'll take this one down.

    There is no implicit difference between the header of a dynamic vs static response.

    There does exist a header setting called Cache-Control which can tell a browser that something that does not look static actually is.

    If doing I'm the one doing the web service, I can set the header to have Cache-Control, but I can not depend on other servers to always do the same.