Changeset 33 in projects


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 ;-) )
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • README.txt

    r31 r33  
    99     http://dev.technikum29.de/projekte/paper-tape-project/documentation/
    1010
    11 
    12   See README.SVN.txt for instructions how to use the svn repository
    13   and COPYING.txt for the GNU GENERAL PUBLIC LICENSE.
     11   See README.SVN.txt for instructions how to use the svn repository
     12   and COPYING.txt for the GNU GENERAL PUBLIC LICENSE.
    1413
    1514
    16   Sven Koeppel, Friday the 13.03.2009
     15   Sven Koeppel, Friday the 13.03.2009
  • 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