Html::header_nocache PHP Method

header_nocache() static public method

Set page not to use the cache
static public header_nocache ( )
    static function header_nocache()
    {
        header("Cache-Control: no-store, no-cache, must-revalidate");
        // HTTP/1.1
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        // Date du passe
    }

Usage Example

Example #1
0
 /**
  * Show API header
  * in debug, it add body and some libs (essentialy to colorise markdown)
  * otherwise, it change only Content-Type of the page
  *
  * @param $html      (default false)
  * @param $title     (default '')
  **/
 protected function header($html = false, $title = "")
 {
     // Send UTF8 Headers
     $content_type = "application/json";
     if ($html) {
         $content_type = "text/html";
     }
     header("Content-Type: {$content_type}; charset=UTF-8");
     // Send extra expires header
     Html::header_nocache();
     if ($html) {
         if (empty($title)) {
             $title = $this->getTypeName();
         }
         Html::includeHeader($title);
         // Body with configured stuff
         echo "<body>";
         echo "<div id='page'>";
     }
 }
All Usage Examples Of Html::header_nocache
Html