V
V
Vanya Zyuzgin2015-11-22 23:21:55
PHP
Vanya Zyuzgin, 2015-11-22 23:21:55

How to 100% disable page caching?

You need to disable caching for a specific page. I tried to use different html tags and send headers, but the effect is opposite. The page was both cached and cached (I checked the returned headers, they are sent with a request not to cache).
In PHP I tried this:

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

PS I'm already sinning on nginx, which is installed on the server as the only web server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-11-22
@Stalker_RED

The client may have the wrong time. Substitute a date from the past in expires, just in case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question