Jelajahi Sumber

output a last-modified date if known; should prevent stylesheet from being
refetched on every pageload

Thijs Kinkhorst 19 tahun lalu
induk
melakukan
ac2d8daaba
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      src/style.php

+ 6 - 1
src/style.php

@@ -173,7 +173,12 @@ if (! sqgetGlobalVar('fontsize',$fontsize,SQ_GET)) {
 $oTemplate->assign('fontsize', $fontsize);
 
 header('Content-Type: text/css');
+// output a last-modified header if we can
+if ( $lastmod = @filemtime($oTemplate->template_dir . 'stylesheet.tpl') ) {
+    $gmlastmod = gmdate('D, d M Y H:i:s', $lastmod) . ' GMT';
+    header('Last-Modified: ' . $gmlastmod);
+}
 
 $oTemplate->display('stylesheet.tpl');
 
-?>
+?>