Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/functions.php:20) in /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/functions.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/functions.php:20) in /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/functions.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/functions.php:20) in /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/functions.php on line 15
Enable Better Caching

Enable Better Caching

http://www.bradshawenterprises.com/blog/2009/enable-better-caching-on-your-website-using-php/

/** tells useragents accessing site that the content hasn't changed **/
function caching_headers ($file, $timestamp) {
	$gmt_mtime = gmdate('r', $timestamp);
	header('ETag: "'.md5($timestamp.$file).'"');
 
	if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
		if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $gmt_mtime || str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == md5($timestamp.$file)) {
			header('HTTP/1.1 304 Not Modified');
			exit();
		}
	}
 
	header('Last-Modified: '.$gmt_mtime);
	header('Cache-Control: public');
	return 1;
}

caching_headers ($_SERVER['SCRIPT_FILENAME'], filemtime($_SERVER['SCRIPT_FILENAME']));

Warning: require_once(assets/elements/footer-dev.html) [function.require-once]: failed to open stream: No such file or directory in /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/better-caching.php on line 43

Fatal error: require_once() [function.require]: Failed opening required 'assets/elements/footer-dev.html' (include_path='.:/usr/local/php-5.3.29/share/pear') in /nfs/c01/h06/mnt/45373/domains/dev.bowdenweb.com/html/php/better-caching.php on line 43