Home  >  Article  >  Backend Development  >  How to set page expiration in php

How to set page expiration in php

藏色散人
藏色散人Original
2020-09-02 10:33:582244browse

php method to set page expiration: first open the corresponding PHP page file; then pass [header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );] method to set page expiration.

How to set page expiration in php

Recommended: "PHP Video Tutorial"

PHP settings page expired

Today I encountered the problem of setting the expiration of PHP pages. Some pages have expired before, and some have not expired. Delete the HTML code about expiration in the page, and use the following code to uniformly control the expiration of the form page submitted under IE. Situation

PHP settings page expires

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

PHP settings page does not expire

session_cache_limiter('private,must-revalidate');

The above is the detailed content of How to set page expiration in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn