forked from jovemnerd/rede-social
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·38 lines (26 loc) · 1.09 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
//TODO Libera Cache
$last_modified_ts = floor(mktime()/30)*30;
$expires = ((60*60)*24)*15;
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $last_modified_ts) header('HTTP/1.1 304 Not Modified');
header("Pragma: public");
header('Cache-Control: must-revalidate');
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
header('Last-Modified: '.gmdate('d M Y H:i:s',$last_modified_ts).' GMT');
// ------------------------------------
//TODO Configura ETags
$content = floor(mktime()/30)*30;
$etag = md5($content);
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $etag) header('HTTP/1.1 304 Not Modified');
header('Cache-Control: must-revalidate');
header('ETag: '.$etag);
// ------------------------------------
*/
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL ^E_NOTICE ^E_WARNING);
require('settings.php');
require('./Phalanx/Phalanx.php');
require('urls.php');
new Phalanx();