1

I've noticed that if you first create a webpage in html and then recreate the exact same page in php. Next check with varvy.com, or something similar, that the html file will say that the if-modified-since function is supported while the php file will say that it is not.

Could someone please tell me why and exactly how to fix it so that it works on the php file as well. Thanks for any help with this.

Some people have marked this as duplicate but I disagree in asking of the difference between html and php as well as in the answer it says the value is set within the $_SERVER['HTTP_IF_MODIFIED_SINCE'] without explaining where that is. More of an answer on how to set it up would be great please

MLS
  • 11
  • 3
  • 4
    With static files, the web server takes care of that. With your PHP script, it _can't_ - because it doesn't know what your script will output. Is it going to be the same as last time - or something different, either in a minimal way (like the current time gets output somewhere on the page), or massively and basically a completely different document? Duplicate explains how to handle the headers involved in PHP; but you might have to invest more in the logic, if the last modified time of your content can not be determined as simple as checking a file modification timestamp. – CBroe Mar 30 '18 at 01:57
  • Thank you for clearing that up for me – MLS Mar 31 '18 at 16:04

0 Answers0