webCOMAND

web_launcher::caching_headers()

Produce cache headers (ETag, Last-Modified and Cache-Control) and potentially a "Not Modified" web response for a specific file request.

Prototype

void caching_headers(string $file, string $timestamp = NULL)

Parameters

  • file - Path to the file to server caching headers for.
  • timestamp - Unix timestamp (number of seconds since the Unix Epoch), like what PHP time() returns.  If no timestamp is provided, the last modified time of the file will be used, as returned by filemtime().

Example

\io_comand_package\web_launcher::cache_headers($file_path);