Example #1
0
 /**
  * Changes the status to {@link Status::NOT_MODIFIED} if the request's Cache-Control has
  * 'no-cache' and {@link is_modified} is false.
  */
 public function __invoke()
 {
     $range = $this->range;
     if ($range) {
         if (!$range->is_satisfiable) {
             $this->status = Status::REQUESTED_RANGE_NOT_SATISFIABLE;
         } else {
             if (!$range->is_total) {
                 $this->status = Status::PARTIAL_CONTENT;
             }
         }
     }
     if ($this->request->cache_control->cacheable != 'no-cache' && !$this->is_modified) {
         $this->status = Status::NOT_MODIFIED;
     }
     parent::__invoke();
 }