[Download]
Say you're serving up a CSS file, but it's actually made on-the-fly by PHP, having a .php extension. How can you make sure you're not making your users re-load this file every time the page is accessed?
This script will check the current file's last-modified time against the If-Modified-Since header. If they have fresh results, a HTTP 304 status code will be sent. If they need fresh results, they'll get them.
This code will NEED to be at the very beginning of your PHP script.
This script will check the current file's last-modified time against the If-Modified-Since header. If they have fresh results, a HTTP 304 status code will be sent. If they need fresh results, they'll get them.
This code will NEED to be at the very beginning of your PHP script.