public function isCacheValid($api, $class)
    {
        // get the modified time of the $class
        try {
            $reflection = new \ReflectionClass($class);
        } catch (\Exception $e) {
            throw new RestException('Unable to validate the cache for ' . $class . '. ' . $e->getMessage());
        }

        $classModTime = filemtime($reflection->getFileName());

        return $this->cacheDriver->isFresh($api, $class, 'current', $classModTime);
    }