Created
October 4, 2011 13:39
-
-
Save mudrd8mz/1261665 to your computer and use it in GitHub Desktop.
Temporary solution of Moodle sending 304 header even when revision -1 is requested
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/theme/yui_combo.php b/theme/yui_combo.php | |
index 8d46a1d..2f631be 100644 | |
--- a/theme/yui_combo.php | |
+++ b/theme/yui_combo.php | |
@@ -48,7 +48,7 @@ if (substr($parts, -3) === '.js') { | |
// if they are requesting a revision that's not -1, and they have supplied an | |
// If-Modified-Since header, we can send back a 304 Not Modified since the | |
// content never changes (the rev number is increased any time the content changes) | |
-if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) || !empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { | |
+if (!empty($CFG->cachejs) && (!empty($_SERVER['HTTP_IF_NONE_MATCH']) || !empty($_SERVER['HTTP_IF_MODIFIED_SINCE']))) { | |
$lifetime = 60*60*24*30; // 30 days | |
header('HTTP/1.1 304 Not Modified'); | |
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment