| File root/index.php changed (mode: 100644) (index 4a18a23..e5dc14c) |
| ... |
... |
if ($rg['login_ui']['uid'] > 0) { |
| 155 |
155 |
|
|
| 156 |
156 |
|
|
| 157 |
157 |
$rg['HTML:rg_body'] = $body; |
$rg['HTML:rg_body'] = $body; |
| 158 |
|
// DEBUG: aici deja e busit content-ul! Merg inapoi pe fir. |
|
| 159 |
158 |
$_c = rg_template("index.html", $rg, TRUE /* xss */); |
$_c = rg_template("index.html", $rg, TRUE /* xss */); |
| 160 |
159 |
|
|
| 161 |
160 |
header('Cache-Control: private, no-cache'); |
header('Cache-Control: private, no-cache'); |
| 162 |
161 |
|
|
| 163 |
162 |
// Caching |
// Caching |
| 164 |
|
$we_have = sha1($_c); |
|
| 165 |
|
if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) |
|
| 166 |
|
$client_have = $_SERVER['HTTP_IF_NONE_MATCH']; |
|
| 167 |
|
else |
|
| 168 |
|
$client_have = ''; |
|
| 169 |
|
|
|
| 170 |
|
if (strcmp($client_have, $we_have) == 0) { |
|
| 171 |
|
rg_log('Client has the right version'); |
|
| 172 |
|
header('HTTP/1.1 304 Not modified'); |
|
| 173 |
|
header('ETag: ' . $we_have); |
|
|
163 |
|
$proto = rg_var_str('SERVER_PROTOCOL'); |
|
164 |
|
rg_log('DEBUG: proto=' . $proto); |
|
165 |
|
if (strcmp($proto, 'HTTP/1.1') == 0) { |
|
166 |
|
$we_have = sha1($_c); |
|
167 |
|
if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) |
|
168 |
|
$client_have = $_SERVER['HTTP_IF_NONE_MATCH']; |
|
169 |
|
else |
|
170 |
|
$client_have = ''; |
|
171 |
|
|
|
172 |
|
if (strcmp($client_have, $we_have) == 0) { |
|
173 |
|
rg_log('CACHE: Client has the right version'); |
|
174 |
|
header('HTTP/1.1 304 Not modified'); |
|
175 |
|
header('ETag: ' . $we_have); |
|
176 |
|
} else { |
|
177 |
|
rg_log('CACHE: Client has NOT the right version [' . $client_have . ']'); |
|
178 |
|
header('ETag: ' . $we_have); |
|
179 |
|
echo $_c; |
|
180 |
|
} |
| 174 |
181 |
} else { |
} else { |
| 175 |
|
rg_log('Client has NOT the right version [' . $client_have . ']'); |
|
| 176 |
|
header('ETag: ' . $we_have); |
|
| 177 |
182 |
echo $_c; |
echo $_c; |
| 178 |
183 |
} |
} |
| 179 |
184 |
|
|