dvMayCacheRenderedPage function

bool dvMayCacheRenderedPage(
  1. String method,
  2. Map<String, String> headers,
  3. Map? route, {
  4. required bool staticContent,
})

Only compiled manifest content may be shared; callers additionally prove that no data resolver runs. Even an anonymous request carrying a cookie is bypassed, including when a previously cached document exists.

Implementation

bool dvMayCacheRenderedPage(
  String method,
  Map<String, String> headers,
  Map? route, {
  required bool staticContent,
}) =>
    method == 'GET' &&
    staticContent &&
    route != null &&
    route['guarded'] != true &&
    route['cache'] != false &&
    route['location'] == null &&
    !headers.keys.any(
      (k) => const {
        'cookie',
        'authorization',
        'proxy-authorization',
      }.contains(k.toLowerCase()),
    );