Home > Backend Development > PHP Tutorial > 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中文网
Release: 2023-03-01 07:40:02
Original
6729 people have browsed it

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
Copy after login

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

03. Settings about page cache in Apache

04.ob_clean(); Try it?                                                                                      

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template