private static function cachingClient($actionContext) {
        $cacheSettings = InternalHelper::getStaticPropertyValue('\\PhpMvc\\OutputCache', 'settings');
        $actionName = $actionContext->getActionName();

        // location
        if (!empty($cacheSettings[$actionName]['location'])) {
            $location = intval($cacheSettings[$actionName]['location']);
        }
        elseif (!empty($cacheSettings['.']['location'])) {
            $location = intval($cacheSettings['.']['location']);
        }
        else {
            $location = OutputCacheLocation::ANY;
        }

        // duration
        if (!empty($cacheSettings[$actionName]['duration'])) {
            $duration = intval($cacheSettings[$actionName]['duration']);
        }
        elseif (!empty($cacheSettings['.']['duration'])) {
            $duration = intval($cacheSettings['.']['duration']);
        }
        else {
            $duration = 0;
        }

        // send headers
        $httpContext = $actionContext->getHttpContext();
        $response = $httpContext->getResponse();
        $cacheControl = array();

        switch ($location) {
            case OutputCacheLocation::ANY:
            case OutputCacheLocation::DOWNSTREAM:
                $cacheControl[] = 'public';
                break;

            case OutputCacheLocation::NONE:
                $cacheControl[] = 'no-cache';
                $cacheControl[] = 'must-revalidate';
                $pragma = 'no-cache';
                break;

            case OutputCacheLocation::SERVER:
                $cacheControl[] = 'no-cache';
                $pragma = 'no-cache';
                break;

            case OutputCacheLocation::CLIENT:
            case OutputCacheLocation::SERVER_AND_CLIENT:
                $cacheControl[] = 'private';
                break;
        }

        if ($duration > 0) {
            $cacheControl[] = 'max-age=' . $duration;
        }

        $response->addHeader('Cache-Control', implode(', ', $cacheControl));

        if (isset($pragma)) {
            $response->addHeader('Pragma', $pragma);
        }
    }