src/Middleware/GlideMiddleware.php
protected function _checkModified($request, $response, $server)
    {
        $modifiedTime = false;

        try {
            /** @var int|string|false $modifiedTime */
            $modifiedTime = $server->getSource()
                ->getTimestamp($server->getSourcePath($this->_path));
        } catch (Exception $exception) {
            return $this->_handleException($request, $response, $exception);
        }

        if ($modifiedTime === false) {
            return $modifiedTime;
        }

        if ($this->_isNotModified($request, $modifiedTime)) {
            $response = new Response(['status' => 304]);
            $response = $this->_withCustomHeaders($response);

            return $response->withHeader('Last-Modified', (string)$modifiedTime);
        }

        return (int)$modifiedTime;
    }
protected function _checkModified($request, $response, $server)
    {
        $modifiedTime = false;

        try {
            /** @var int|string|false $modifiedTime */
            $modifiedTime = $server->getSource()
                ->getTimestamp($server->getSourcePath($this->_path));
        } catch (Exception $exception) {
            return $this->_handleException($request, $response, $exception);
        }

        if ($modifiedTime === false) {
            return $modifiedTime;
        }

        if ($this->_isNotModified($request, $modifiedTime)) {
            $response = new Response(['status' => 304]);
            $response = $this->_withCustomHeaders($response);

            return $response->withHeader('Last-Modified', (string)$modifiedTime);
        }

        return (int)$modifiedTime;
    }
protected function _checkModified ( $ request , $ response , $ server ) { $ modifiedTime = false ; try { /** @var int|string|false $modifiedTime */ $ modifiedTime = $ server -> getSource ( ) -> getTimestamp ( $ server -> getSourcePath ( $ this -> _path ) ) ; } catch ( Exception $ exception ) { return $ this -> _handleException ( $ request , $ response , $ exception ) ; } if ( $ modifiedTime === false ) { return $ modifiedTime ; } if ( $ this -> _isNotModified ( $ request , $ modifiedTime ) ) { $ response = new Response ( [ 'status' => 304 ] ) ; $ response = $ this -> _withCustomHeaders ( $ response ) ; return $ response -> withHeader ( 'Last-Modified' , ( string ) $ modifiedTime ) ; } return ( int ) $ modifiedTime ; }
Get file's modified time.

After comparing with "If-Modified-Since" either return modified time or
response with 304 Not Modified status.

@param \Psr\Http\Message\ServerRequestInterface $request The request.
@param \Psr\Http\Message\ResponseInterface $response The response.
@param \League\Glide\Server $server Glide server.

@return \Psr\Http\Message\ResponseInterface|int|false
Get file s modified time .