public function getMaxAge(): int
    {
        if ($this->hasCacheControl('s-maxage')) {
            return $this->getCacheControl('s-maxage');
        }

        if ($this->hasCacheControl('max-age')) {
            return $this->getCacheControl('max-age');
        }

        if (null !== $this->getExpires()) {
            return date('U', strtotime($this->getExpires())) - date(
                    'U',
                    strtotime(
                        $this->getDateHeader()
                    )
                );
        }

        return 0;
    }