Make PHP page return “304 Not Modified” if it hasn't been modified

前端 未结 4 818
有刺的猬
有刺的猬 2020-12-17 03:33

I have a PHP file that will return the same thing with the same $_GET parameters every time -- it\'s deterministic.

Unfortunately for efficiency (this file is reques

4条回答
  •  清酒与你
    2020-12-17 04:12

    Have you tried header("HTTP/1.0 304 Not Modified"); in your PHP code that is getting called? If unfamiliar you will want to put that in your code BEFORE you start outputting anything to the buffer.

    http://php.net/manual/en/function.header.php

提交回复
热议问题