Explorar o código

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

Thijs Kinkhorst %!s(int64=19) %!d(string=hai) anos
pai
achega
ac2d8daaba
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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');
 
-?>
+?>