Function __global->set_http_caching

Definitions

sources/global2.php

  • Set HTTP caching in a conclusive and simple way.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$last_modified ?TIME No No required parameter N/A N/A When the resource was last modified (null: dynamic non-cached request)
$public boolean No No False N/A N/A Whether the request is public (can be cached in public proxy caches)
$expiry_seconds TIME No No 604800 N/A N/A Seconds until cache expires (only applicable if $last_modified is not null)

Preview

Code (PHP)

/**
 * Set HTTP caching in a conclusive and simple way.
 *
 * @param  ?TIME $last_modified When the resource was last modified (null: dynamic non-cached request)
 * @param  boolean $public Whether the request is public (can be cached in public proxy caches)
 * @param  TIME $expiry_seconds Seconds until cache expires (only applicable if $last_modified is not null)
 */

function set_http_caching(?int $last_modified, bool $public = false, int $expiry_seconds = 604800)
 

sources/minikernel.php

  • Set HTTP caching in a conclusive and simple way.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$last_modified ?TIME No No required parameter N/A N/A When the resource was last modified (null: dynamic non-cached request)
$public boolean No No False N/A N/A Whether the request is public (can be cached in public proxy caches)
$expiry_seconds TIME No No 604800 N/A N/A Seconds until cache expires (only applicable if $last_modified is not null)

Preview

Code (PHP)

/**
 * Set HTTP caching in a conclusive and simple way.
 *
 * @param  ?TIME $last_modified When the resource was last modified (null: dynamic non-cached request)
 * @param  boolean $public Whether the request is public (can be cached in public proxy caches)
 * @param  TIME $expiry_seconds Seconds until cache expires (only applicable if $last_modified is not null)
 */

function set_http_caching(?int $last_modified, bool $public = false, int $expiry_seconds = 604800)