28#ifndef PROTOCORE_HTTPCACHE_H
29#define PROTOCORE_HTTPCACHE_H
33#if PC_ENABLE_HTTP_CACHE
45struct pc_cache_control
54 bool proxy_revalidate;
62 int32_t stale_while_revalidate;
63 int32_t stale_if_error;
69void cache_control_init(pc_cache_control *cc);
79size_t cache_control_build(
char *buf,
size_t cap,
const pc_cache_control *cc);
89bool cache_control_parse(
const char *s,
size_t len, pc_cache_control *cc);
94void cache_immutable_asset(pc_cache_control *cc, uint32_t max_age);
100void cache_revalidatable(pc_cache_control *cc, uint32_t max_age, int32_t stale_while_revalidate);
103void cache_no_store(pc_cache_control *cc);
106void cache_shared(pc_cache_control *cc, uint32_t max_age, uint32_t s_maxage);
116long cache_freshness_lifetime(
const pc_cache_control *cc,
bool shared,
long expires_minus_date);
User-facing configuration for ProtoCore.