Permalink
Browse files

Adding compressing of the js.

  • Loading branch information...
1 parent affdd08 commit abd514b1d362188b9869af555da1f18d4176d2ce @mithro committed Apr 10, 2011
Showing with 24 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +4 −0 TODO
  3. +7 −0 compile.sh
  4. +1 −0 get_title.php
  5. +9 −1 index.php
View
@@ -0,0 +1,3 @@
+jquery.extra*
+xcache
+.*.sw*
View
4 TODO
@@ -0,0 +1,4 @@
+
+
+ - Add instructions on how to use the site.
+ - Add social intergration (IE tweet/dig/etc.)
View
@@ -0,0 +1,7 @@
+#! /bin/sh
+cat \
+ ./getscrollbarwidth/jquery.getscrollbarwidth.js \
+ ./splatter/src/jquery.splatter.js \
+ | sed -e's-/\*\!-/*-' > jquery.extra.js
+
+yui-compressor jquery.extra.js -o jquery.extra.min.js
View
@@ -88,6 +88,7 @@ function get_web_page( $url )
$expstr = "Expires: " . gmdate("D, d M Y H:i:s", 0) . " GMT";
header($expstr);
}
+header("Last-Modified: ". gmdate("D, d M Y H:i:s", time()) . " GMT");
// This is a json response
header("Content-Type: application/javascript");
View
@@ -36,6 +36,14 @@
$jsurl = json_encode($url);
$jsurl = substr($jsurl, 1, strlen($jsurl)-2);
$htmlurl = htmlspecialchars($url);
+
+// Set the cache headers
+$CACHEFOR = 60*60*24*7;
+header("Cache-Control: max-age=$CACHEFOR, public");
+$expstr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $CACHEFOR) . " GMT";
+header($expstr);
+header("Last-Modified: ". gmdate("D, d M Y H:i:s", time()) . " GMT");
+header("Content-Type: text/html; charset=UTF-8");
?>
<html>
<head>
@@ -192,7 +200,7 @@
</style>
</head>
-<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js' type='text/javascript' charset='utf-8'></script>
+<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js' type='text/javascript' charset='utf-8'></script>
<script src='/getscrollbarwidth/jquery.getscrollbarwidth.js' type='text/javascript' charset='utf-8'></script>
<body onload='onLoad();'>

0 comments on commit abd514b

Please sign in to comment.