Moss · API
renderDocument
Draws a page for whoever the request’s session cookie names, and answers it with the headers it goes out with. Who the page was drawn for is the whole rule: no page declares its own cache policy. Example: with no cookie the page is drawn for nobody and goes out with Cache-Control: no-cache; with Grace’s it goes out with private, no-store, both with Vary: Cookie.
renderDocument({ server, template, request: { path: '/', cookie: '' }, draw })
renderDocument({ server, template, request: { path: '/', cookie: 'nisc.token=eyJzdWIiOiJncmFjZSJ9' }, draw }){
'cache-control': 'no-cache',
'vary': 'Cookie',
}{
'cache-control': 'private, no-store',
'vary': 'Cookie',
}Computed when this site was built, by the installed package, which does not run in a browser. The site’s checks recompute it on every change.