OxL Справочник OxL
РусскийEnglish

data CacheRule

Cache-Control for the paths that match pattern: a glob with at most one * (assets/*, *.html, *).

Example:

oxl✓ проверяется в CI
use std.web { CacheRule, cacheRule }

fn main() io {
  let r: CacheRule = cacheRule("assets/*", "public, max-age=31536000, immutable")
  print("{r.pattern} -> {r.control}")
}
Вывод
assets/* -> public, max-age=31536000, immutable
@derive(Clone)
pub(api) data CacheRule

Потокобезопасность. an immutable value; safe to share.

С версии. 1.0.0-beta

Поля

pub(api) pattern: str

A glob with at most one * (assets/*, *.html).

pub(api) control: str

The Cache-Control value to send.

Определено в: std/web/web.oxl:69

См. также