Commit ecd82009 authored by Taddeus Kroes's avatar Taddeus Kroes

Removed some debug lines and trimmed cached file contents.

parent b2bb93a6
...@@ -84,7 +84,7 @@ class pQueryCache extends pQuery implements pQueryExtension { ...@@ -84,7 +84,7 @@ class pQueryCache extends pQuery implements pQueryExtension {
* *
*/ */
function concatenate() { 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; return $this;
} }
...@@ -107,21 +107,14 @@ class pQueryCache extends pQuery implements pQueryExtension { ...@@ -107,21 +107,14 @@ class pQueryCache extends pQuery implements pQueryExtension {
method_exists($this, 'set_headers') && $this->set_headers(); method_exists($this, 'set_headers') && $this->set_headers();
if( $admin_updated = $this->admin_updated() || !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) { if( $admin_updated = $this->admin_updated() || !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) {
//echo 'admin updated';
$this->save(); $this->save();
} elseif( !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) {
//echo 'hard refresh';
//$this->concatenate();
} elseif( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) { } elseif( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) {
$if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'])); $if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']));
if( $if_modified_since >= $last_modified ) { if( $if_modified_since >= $last_modified ) {
//echo 'not modified';
// Not modified // Not modified
header((php_sapi_name() == 'CGI' ? 'Status:' : 'HTTP/1.0').' 304 Not Modified'); header((php_sapi_name() == 'CGI' ? 'Status:' : 'HTTP/1.0').' 304 Not Modified');
exit; exit;
} else {
//echo 'modified';
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment