Changeset 33 in projects for documentation


Ignore:
Timestamp:
Mar 13, 2009, 6:45:57 PM (15 years ago)
Author:
sven
Message:

Documentation improvements

  • documentation/index.php: Implemented a simple HTTP header tag

caching

  • README.txt: alignment fix (only for testing caching system ;-) )
File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/index.php

    r32 r33  
    4444      echo "Won't make file $filename beautiful\nRefering to that file...\n";
    4545      exit;
     46  }
     47
     48  // do a little bit lightweight caching:
     49  // don't calculate etag since that's too expensive
     50  $last_modified_time = max(
     51      filemtime("../$filename"), filemtime($_SERVER['SCRIPT_FILENAME'])
     52  );
     53  #$etag = md5_file("../$filename");
     54
     55  header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT");
     56  #header("Etag: $etag");
     57
     58  if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time) {
     59     #|| trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
     60     header("HTTP/1.1 304 Not Modified");
     61     exit;
    4662  }
    4763
     
    151167</div>
    152168<div id="footer">
     169  Last modified: <?=date('r', $last_modified_time); ?>
     170  <br/>
    153171  Further reading:
    154172  <a href="http://dev.technikum29.de">dev.technikum29.de</a> |
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License