Home  >  Article  >  Backend Development  >  How to clear the browser cache of the current page in php?

How to clear the browser cache of the current page in php?

PHP中文网
PHP中文网Original
2017-04-18 10:04:546710browse

This is it. I modified a website and added a button to jump between http and https on the homepage. The homepage test is OK.

(Homepage, gray icon is http, green is https)
How to clear the browser cache of the current page in php?
(Content page, switch to https, it will be forced to use https access, only clear the browser cache)
How to clear the browser cache of the current page in php?
Me I thought it was definitely a browser cache problem, and then I set up not caching on the program and server, but it still didn't work. Is there any solution?

Everyone, thank you for your attention. I have discovered the reason. It is because HSTS is turned on. Just turn it off.

4 answers

01. It may also be session

02. Set the request header to not use cache (no-cache)

CacheControl = no-cache
Pragma=no-cache
Expires = -1

An article I found on Baidu, reference: Header function parameters in php

03. Settings about page cache in Apache

04.ob_clean(); Try it?                                                                                      

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