in PHP can easily use the following statement to implement prohibit page caching, but it is difficult to remember the special arrangement, convenient for everyone to use. Core code:
Copy the Code code as follows:
header ("Expires:mon, Jul 1997 05:00:00 GMT");
header ("last-modified:". Gmdate ("D, D M Y h:i:s"). " GMT ");
header ("Cache-control:no-cache, must-revalidate");
header ("Pramga:no-cache");
This is useful for some pages, such as: verification code, because each generation of verification code must be different, otherwise the verification code does not make any sense, this can be implemented with the above statement to prohibit caching.
Another example: "Every huitie once a beautiful picture", the page cache must be disabled, otherwise the same image is returned in the cache.
recently saw the League of Baidu Alliance-"How to let Netizens Love your website" (mainly to discuss how to improve the user experience) to associate with one point:
take the forum as an example, when the user logged in after the landing page, such as "management", "modify data", etc., when the user quit the forum, again back to the page,
There are still "management", "modify data" and so on (because the cache page is returned), although the cookie has been emptied, "management", "modify material" and so on has not worked,
but users still think that this is a valid page, so that others can also "manage", "modify the material" and so on, that the site is unsafe (although it is actually safe). It is useful to add the above code on a page that requires cookie verification, at least to eliminate the negative effects on the user's mind.
PHP adds HTTP headers to disallow browser caching