(res: Response, noCache: boolean)
| 130 | } |
| 131 | |
| 132 | function applyCacheHeaders(res: Response, noCache: boolean): Response { |
| 133 | if (noCache) { |
| 134 | res.headers.set("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"); |
| 135 | res.headers.set("Pragma", "no-cache"); |
| 136 | res.headers.set("Expires", "0"); |
| 137 | } else { |
| 138 | res.headers.set("Cache-Control", "public, max-age=3600"); |
| 139 | } |
| 140 | return res; |
| 141 | } |
| 142 | |
| 143 | export function startServer(options: ServeOptions = {}): RunningServer { |
| 144 | const noCache = options.noCache ?? false; |