Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 688
Zeile 756... Zeile 756...
756
 
756
 
757
        if ($this->headers->hasCacheControlDirective('max-age')) {
757
        if ($this->headers->hasCacheControlDirective('max-age')) {
758
            return (int) $this->headers->getCacheControlDirective('max-age');
758
            return (int) $this->headers->getCacheControlDirective('max-age');
Zeile 759... Zeile 759...
759
        }
759
        }
760
 
760
 
-
 
761
        if (null !== $expires = $this->getExpires()) {
-
 
762
            $maxAge = (int) $expires->format('U') - (int) $this->getDate()->format('U');
761
        if (null !== $this->getExpires()) {
763
 
Zeile 762... Zeile 764...
762
            return (int) $this->getExpires()->format('U') - (int) $this->getDate()->format('U');
764
            return max($maxAge, 0);
763
        }
765
        }
Zeile 833... Zeile 835...
833
    /**
835
    /**
834
     * Returns the response's time-to-live in seconds.
836
     * Returns the response's time-to-live in seconds.
835
     *
837
     *
836
     * It returns null when no freshness information is present in the response.
838
     * It returns null when no freshness information is present in the response.
837
     *
839
     *
838
     * When the responses TTL is <= 0, the response may not be served from cache without first
840
     * When the response's TTL is 0, the response may not be served from cache without first
839
     * revalidating with the origin.
841
     * revalidating with the origin.
840
     *
842
     *
841
     * @final
843
     * @final
842
     */
844
     */
843
    public function getTtl(): ?int
845
    public function getTtl(): ?int
844
    {
846
    {
845
        $maxAge = $this->getMaxAge();
847
        $maxAge = $this->getMaxAge();
Zeile 846... Zeile 848...
846
 
848
 
847
        return null !== $maxAge ? $maxAge - $this->getAge() : null;
849
        return null !== $maxAge ? max($maxAge - $this->getAge(), 0) : null;
Zeile 848... Zeile 850...
848
    }
850
    }
849
 
851
 
850
    /**
852
    /**