PHP Header
$TESTSTR = "AAA";
$TESTSTR = "CCCCCCCCC";
Header ("http/1.1 304 not Modified");
Echo $testStr;
?>
Why my code will not output
Reply to discussion (solution)
You don't know what 304 means?
304 means the body is the same as "last", only the header, not the body, usually used in response to the client refresh (that is, a short time before the send)
304 can reduce the server a lot of traffic, but used in the program to "last" judge accurate, grasp the time period is not easy
For dynamic page cache acceleration, first add the last Modified definition in the HTTP Header of Response, followed by the If Modified Since and the requested content update time in request to return 200 or 304. Although the database query has been done at the time of return 304, but can avoid the next more database query, and do not return the page content and just an HTTP Header, thereby greatly reducing the bandwidth consumption, the user's feeling is also improved.
Thank you for the answer, I was doing the etag, all answered the point, the problem has been resolved