Ejemplo n.º 1
0
 /**
  * This functions checks if a certain response resides in cache.
  * In case it does, the response is returned from cache and a response header is added.
  * There are two possibilities on which this function is called:
  * 1)	The request is a single 'stand alone' request (maybe this request is a multi request containing several sub-requests)
  * 2)	The request is a single request that is part of a multi request (sub-request in a multi request)
  *
  * in case this function is called when handling a sub-request (single request as part of a multirequest) it
  * is preferable to change the default $cacheHeaderName
  *
  * @param $cacheHeaderName - the header name to add
  * @param $cacheHeader - the header value to add
  */
 public function checkCache($cacheHeaderName = 'X-Kaltura', $cacheHeader = 'cached-dispatcher')
 {
     $result = $this->checkCacheInternal($cacheHeaderName, $cacheHeader);
     if (isset($this->_params['service'])) {
         $isInMultiRequest = isset($this->_params['multirequest']);
         $action = $this->_params['service'];
         if ($action != 'multirequest' && isset($this->_params['action'])) {
             $action = $this->_params['service'] . '.' . $this->_params['action'];
         }
         KalturaMonitorClient::monitorApiStart($result !== false, $action, $this->_partnerId, $this->getCurrentSessionType(), $this->clientTag, $isInMultiRequest);
     }
     return $result;
 }