Add some performance info to jsres
authorDan
Thu, 20 Nov 2008 22:51:02 -0500
changeset 746 f81f2a4f8d04
parent 745 0a3866f74faa
child 747 cffe13960330
Add some performance info to jsres
includes/clientside/jsres.php
--- a/includes/clientside/jsres.php	Thu Nov 20 22:50:32 2008 -0500
+++ b/includes/clientside/jsres.php	Thu Nov 20 22:51:02 2008 -0500
@@ -294,6 +294,7 @@
     {
       if ( $cache_file['md5'] === $file_md5 )
       {
+        header("X-Cache-Status: cache HIT, hash $file_md5");
         $loaded_cache = true;
         $file_contents = $cache_file['src'];
       }
@@ -315,7 +316,16 @@
         ));
       fwrite($handle, $payload);
       fclose($handle);
+      header("X-Cache-Status: cache MISS, new generated");
     }
+    else
+    {
+      header("X-Cache-Status: cache MISS, not generated");
+    }
+  }
+  else if ( !$loaded_cache )
+  {
+    header("X-Cache-Status: cache MISS, not generated");
   }
   
   return $file_contents;