Skip to content

Commit

Permalink
MDL-40889 prevent 304 when minimising JS
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 2, 2013
1 parent a3d12f9 commit 093aeff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/jslib.php
Expand Up @@ -107,6 +107,11 @@ function js_minify($files) {
return '';
}

// We do not really want any 304 here!
// There does not seem to be any better way to prevent them here.
unset($_SERVER['HTTP_IF_NONE_MATCH']);
unset($_SERVER['HTTP_IF_MODIFIED_SINCE']);

if (0 === stripos(PHP_OS, 'win')) {
Minify::setDocRoot(); // IIS may need help
}
Expand All @@ -132,7 +137,7 @@ function js_minify($files) {
$error = 'unknown';
try {
$result = Minify::serve('Files', $options);
if ($result['success']) {
if ($result['success'] and $result['statusCode'] == 200) {
return $result['content'];
}
} catch (Exception $e) {
Expand Down

0 comments on commit 093aeff

Please sign in to comment.