Home  >  Article  >  Backend Development  >  How to clear browser cache in php

How to clear browser cache in php

藏色散人
藏色散人Original
2021-06-18 09:19:363612browse

php method to clear the browser cache: first open the corresponding code file; then add the code "header("Cache-Control: no-cache, must-revalidate" );" to clear the browser cache.

How to clear browser cache in php

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

How to clear the browser cache with php?

php clear browser cache

I encountered a small problem during the development process today. I modified the cover of a book in the background. After uploading the image, the browser cache caused the modification. , the original cover is still displayed in the background, and later two lines of code were added to solve the problem.

header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );  
header("Cache-Control: no-cache, must-revalidate" );

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to clear browser cache 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