summaryrefslogtreecommitdiff
path: root/itjs.php
diff options
context:
space:
mode:
authorUrban Müller2013-10-16 16:09:38 +0000
committerUrban Müller2013-10-16 16:09:38 +0000
commitdf01a22705e1d560d3932fd482f5dcf2ecb5eca7 (patch)
treef02467aa5fc5f1cb4bf38e7fc5b72c6c8cbb4e8a /itjs.php
parent481159435fa6d3acc2532e1c3af181c2375a1e9d (diff)
downloaditools-df01a22705e1d560d3932fd482f5dcf2ecb5eca7.tar.gz
itools-df01a22705e1d560d3932fd482f5dcf2ecb5eca7.tar.bz2
itools-df01a22705e1d560d3932fd482f5dcf2ecb5eca7.zip
compute checksum over actually used files, cache checksum, kill checksum in delivery
Diffstat (limited to 'itjs.php')
-rw-r--r--itjs.php15
1 files changed, 3 insertions, 12 deletions
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'])
{