OxL Reference

fn cacheRule

A Cache-Control rule: files whose path matches pattern (a glob with at most one *) are served with control.

Example:

oxl✓ checked in CI
use std.web { cacheRule }

fn main() io {
  let r = cacheRule("*.html", "no-cache")
  print("{r.pattern}")
}
Output
*.html
pub(api) fn cacheRule(pattern: str, control: str) -> CacheRule

Complexity. O(1).

Since. 1.0.0-beta

Parameters

NameType
patternstr
controlstr

Returns

CacheRule

Effects

none declared (pure unless the body says otherwise)

Defined in: std/web/web.oxl:93

See also