Skip to content
Permalink
Browse files

MDL-40889 prevent 304 when minimising JS

  • Loading branch information...
skodak committed Jul 26, 2013
1 parent b87b729 commit ef7c73d5d81a2c3e1755b5b3ae2b38b660c8f1d6
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/jslib.php
@@ -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
}
@@ -130,7 +135,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) {

0 comments on commit ef7c73d

Please sign in to comment.
You can’t perform that action at this time.