aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_css/css.php7
-rw-r--r--engine/lib/elgglib.php11
2 files changed, 11 insertions, 7 deletions
diff --git a/_css/css.php b/_css/css.php
index 485ca8774..af8b10f36 100644
--- a/_css/css.php
+++ b/_css/css.php
@@ -12,14 +12,15 @@
*/
require_once(dirname(dirname(__FILE__)) . "/engine/start.php");
+
+ $default_css = elgg_view("css");
header("Content-type: text/css", true);
header('Expires: ' . date('r',time() + 864000), true);
header("Pragma: public", true);
header("Cache-Control: public", true);
-
- $default_css = elgg_view("css");
-
+ header("Content-Length: " . strlen($default_css));
+
echo $default_css;
?> \ No newline at end of file
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 7afa7f17f..253421c7f 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1937,13 +1937,16 @@
function js_page_handler($page) {
if (is_array($page) && sizeof($page)) {
+ $js = str_replace('.js','',$page[0]);
+ $return = elgg_view('js/' . $js);
+
header('Content-type: text/javascript');
header('Expires: ' . date('r',time() + 864000));
header("Pragma: public");
- header("Cache-Control: public");
- $js = str_replace('.js','',$page[0]);
- echo elgg_view('js/' . $js);
-
+ header("Cache-Control: public");
+ header("Content-Length: " . strlen($return));
+
+ echo $return;
exit;
}