CMS  Version 3.9
styles.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::usingFeature("cache");
3 
4 $last_modified = Cache::get("css_cache_timestamp");
5 
6 if(array_key_exists("HTTP_IF_MODIFIED_SINCE",$_SERVER))
7 {
8 
9  $if_modified_since=strtotime($_SERVER["HTTP_IF_MODIFIED_SINCE"]);
10 
11  if ($if_modified_since >= $last_modified)
12  {
13  header("HTTP/1.0 304 Not Modified");
14  $noChange = true;
15  }
16 }
17 
18 header("Last-Modified: ".date('r', $last_modified));
19 header("Cache-Control: max-age=300, must-revalidate");
20 header("Content-Type: text/css");
21 header("Pragma: private");
22 header("Expires: " . date(DATE_RFC822,strtotime(" 2 day")));
23 
24 if (!$noChange)
25 {
28  echo $content;
30 
32  {
33  header("Content-Length: ".strlen($content));
34  }
35 }
36 
37 ?>
static usingFeature()
Uses the specified framework feature(s).
Definition: core.inc:388
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
Definition: styles.css.inc:24
$last_modified
Definition: styles.inc:4