Skip to content

serializeContext

serializeContext(bag): string

Serializes the context bag with stable key order, so two equal bags produce one string — one cache key here, one CDN-cacheable URL downstream. The bag is flat by the server’s own rule (ContextBagParser: scalars and string lists only), so sorting the top level is sufficient. undefined properties are dropped, since JSON has no way to carry them anyway.

ContextBag

string