Skip to content
Snippets Groups Projects
Commit ecd82009 authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

Removed some debug lines and trimmed cached file contents.

parent b2bb93a6
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ class pQueryCache extends pQuery implements pQueryExtension {
*
*/
function concatenate() {
$this->content = implode("\n", array_map('file_get_contents', $this->files));
$this->content = trim(implode("\n", array_map('file_get_contents', $this->files)));
return $this;
}
......@@ -107,21 +107,14 @@ class pQueryCache extends pQuery implements pQueryExtension {
method_exists($this, 'set_headers') && $this->set_headers();
if( $admin_updated = $this->admin_updated() || !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) {
//echo 'admin updated';
$this->save();
} elseif( !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) {
//echo 'hard refresh';
//$this->concatenate();
} elseif( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) {
$if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']));
if( $if_modified_since >= $last_modified ) {
//echo 'not modified';
// Not modified
header((php_sapi_name() == 'CGI' ? 'Status:' : 'HTTP/1.0').' 304 Not Modified');
exit;
} else {
//echo 'modified';
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment