Home > Backend Development > PHP Tutorial > Several ways to disable page caching

Several ways to disable page caching

WBOY
Release: 2016-07-25 09:12:57
Original
1329 people have browsed it

How to disable page caching.

1. HTML prohibits page caching, just add it to the header.

Copy code

2, method in asp

  1. response.buffer = true
  2. response.expiresabsolute = now() - 1
  3. response.expires = 0
  4. response.cachecontrol = "no-cache"
  5. response.addheader "pragma", "no-cache"
Copy code

3, page caching is disabled in php.

  1. header('expires: mon, 26 jul 1997 05:00:00 gmt');
  2. header('last-modified: ' . gmdate('d, d m y h:i:s ') . 'gmt');
  3. header('cache-control: no-cache, must-revalidate');
  4. header('pragma: no-cache');
  5. ?>
Copy code

Another simplest method is to use ?mt=any data when using ajax.



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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template