A
A
Alexey Chertok2018-11-27 19:48:22
PHP
Alexey Chertok, 2018-11-27 19:48:22

How to disable caching in PHP and browser?

Good afternoon. In general, I ran into a problem. Please help me figure it out.
There is a profile, there is a settings page. I go to the settings page, make changes, save using php + ajax.
I return to the profile page, and no matter how I reload, until command + shift + r (for windows it's ctrl + r and ctrl + f5), the data on the page is not updated.
Registered in index.php headings, but all the same nothing works.

header("Content-type: text/html");
header("Expires: Mon, 23 Jun 1983 17: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");

Please help me figure it out. I don't understand anything.
Also, when I log into my account, a session is written. But the session seems to me there is no sideways at all. Because they work fine, both added and removed.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question