Set the etag header, and some expiry headers. Checks if the etag matches - if it does, terminates the script with '304 Not Modified'. ETag should be specified as a string. Expires should be specified as a number of seconds, after that time the URL will expire. ETags should be something which is unique for that version of the URL. They should use something which is collission-resistant, such as MD5. They should vary based on the Accept-Encoding header, or any other 'accept' headers, if you are supporting them.