query('v'); $matchesServedBytes = is_string($requested) && hash_equals($version, $requested); $response = response($contents, 200, ['Content-Type' => 'application/javascript']) ->setLastModified(DateTime::createFromFormat('U', (string) filemtime($path))); $response->headers->set( 'Cache-Control', $matchesServedBytes ? 'public, max-age=31536000, immutable' : 'no-store' ); return $response; } }