src/Util/ApiLoader.php
protected function handleCacheFromResponse(Response $response, $result)
    {
        // Handle caching if requested
        if ($cacheControl = $response->getHeader('Cache-Control')) {
            // Combine separate header rows
            $cacheControl = implode(', ', $cacheControl);

            if (strpos($cacheControl, 'no-store') === false
                && preg_match('/(?:max-age=)(\d+)/i', $cacheControl, $matches)
            ) {
                $duration = (int) $matches[1];

                $cacheKey = $this->getCacheKey();
                $this->setToCache($cacheKey, $result, $duration);
            }
        }
    }
protected function handleCacheFromResponse(Response $response, $result)
    {
        // Handle caching if requested
        if ($cacheControl = $response->getHeader('Cache-Control')) {
            // Combine separate header rows
            $cacheControl = implode(', ', $cacheControl);

            if (strpos($cacheControl, 'no-store') === false
                && preg_match('/(?:max-age=)(\d+)/i', $cacheControl, $matches)
            ) {
                $duration = (int) $matches[1];

                $cacheKey = $this->getCacheKey();
                $this->setToCache($cacheKey, $result, $duration);
            }
        }
    }
protected function handleCacheFromResponse ( Response $ response , $ result ) { // Handle caching if requested if ( $ cacheControl = $ response -> getHeader ( 'Cache-Control' ) ) { // Combine separate header rows $ cacheControl = implode ( ', ' , $ cacheControl ) ; if ( strpos ( $ cacheControl , 'no-store' ) === false && preg_match ( '/(?:max-age=)(\d+)/i' , $ cacheControl , $ matches ) ) { $ duration = ( int ) $ matches [ 1 ] ; $ cacheKey = $ this -> getCacheKey ( ) ; $ this -> setToCache ( $ cacheKey , $ result , $ duration ) ; } } }
Check the API response for cache control headers and respect them internally in the SilverStripe
cache if found

@param Response $response
@param array|string $result
@throws \Psr\SimpleCache\InvalidArgumentException
Check the API response for cache control headers and respect them internally in the SilverStripe cache if found