]> git.mjollnir.org Git - moodle.git/commitdiff
Explicitly setting mimetype and other things to
authormoodler <moodler>
Sun, 2 Nov 2003 07:01:48 +0000 (07:01 +0000)
committermoodler <moodler>
Sun, 2 Nov 2003 07:01:48 +0000 (07:01 +0000)
  - hopefully fix Norton problems
  - hopefully improve caching

lib/editor/htmlarea.php

index 4c9fa0616a1ce9bc033bae0ddf1021b8db69e32f..7e311c2edc700e1c2d5a4d2b1a6fb8a4a9070bd1 100644 (file)
@@ -1,3 +1,22 @@
+<?php 
+    include("../../config.php");
+
+    $lastmodified = filemtime("htmlarea.php");
+    $lifetime = 1800;
+       
+    header("Content-type: application/x-javascript");  // Correct MIME type
+    header("Last-Modified: " . gmdate("D, d M Y H:i:s", lastmodified) . " GMT");
+    header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
+    header("Cache-control: max_age = $lifetime"); 
+    header("Pragma: ");
+
+       $lang = current_language();
+
+       if (empty($lang)) {
+               $lang = "en";
+       }
+?>
+
 //
 // htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
 // This copyright notice MUST stay intact for use (see license.txt).
 
 // Creates a new HTMLArea object.  Tries to replace the textarea with the given
 // ID with it.
-<?php 
-include("../../config.php");
-       
-       $lang = current_language();
-
-       if (empty($lang)) {
-               $lang = "en";
-       }
-
-?>
 function HTMLArea(textarea, config) {
        if (HTMLArea.checkSupportedBrowser()) {
                if (typeof config == "undefined") {