From df01a22705e1d560d3932fd482f5dcf2ecb5eca7 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 16 Oct 2013 16:09:38 +0000 Subject: compute checksum over actually used files, cache checksum, kill checksum in delivery --- itjs.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'itjs.php') diff --git a/itjs.php b/itjs.php index 65a78fe..90c9252 100644 --- a/itjs.php +++ b/itjs.php @@ -31,18 +31,9 @@ if ($_SERVER['HTTP_IF_NONE_MATCH'] && it::is_live() && !$_REQUEST['retry']) { exit; } -$data = ""; $files = itjs::filenames(it::match('/itjs/([a-z0-9_,.-]*)', $_SERVER['PHP_SELF'])); - -foreach ($files as $file) -{ - ob_start(); # Needs to capture inside loop to guarantee file order - if (!(it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) && it::match('jquery-ui\.css', $file))) - $data .= it::replace(array('^1$' => ""), @include($file), array('utf8' => false)); - $data .= ob_get_clean(); -} - -$checksum = strlen($data) . itjs::checksum($files); +$data = itjs::filecontents($files); +$file = end($files); if (it::match('\.gif$', $file)) { @@ -67,7 +58,7 @@ else if (!it::match('\.html$', $file)) header("Content-Type: application/x-javascript; charset=$charset"); } -@header("Etag: $checksum"); +@header("Etag: alwaysvalid"); if (!preg_match('/Opera/', $_SERVER['HTTP_USER_AGENT']) && it::is_live() && !$_REQUEST['retry']) { -- cgit v1.2.3