Skip to content

Instantly share code, notes, and snippets.

@rewmike
Last active October 5, 2015 22:07
Show Gist options
  • Save rewmike/66a638213d28ef9682af to your computer and use it in GitHub Desktop.
Save rewmike/66a638213d28ef9682af to your computer and use it in GitHub Desktop.
fftb.php
<?php
// !!!
//die('FTTB');
// Set content type and disable encoding
header('Content-Type: text/html; charset=UTF-8');
//header('Transfer-Encoding: chunked');
header('Content-Encoding: none');
//@apache_setenv('no-gzip', 1);
//@apache_setenv('dont-vary', 1);
// Disable gzip compression
//@ini_set('zlib.output_compression', 0);
//@ini_set('zlib.output_handler', 0);
//@ini_set('output_buffering', 0);
//@ini_set('output_handler', '');
//@ini_set('implicit_flush', 1);
//@apache_setenv('no-gzip', 1);
// Disable output buffering
//ob_implicit_flush(true);
//ob_end_flush();
while (@ob_get_level()) ob_end_flush();
ob_start();
// Send some content
function padding () {
echo '<!-- ' . str_repeat(' ', 1024 * 64) . ' -->';
}
// Flush content
function flushit () {
@ob_flush();
flush();
}
// Flush content and delay
function delay ($seconds = 0.25) {
padding();
flushit();
usleep($seconds * 1000000);
}
?><!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>First time to byte</title>
</head>
<body>
<?php padding(); ?>
<?php flushit(); ?>
<div id="page">
<div id="header">
<div id="logo">
<img src="http://cdn4.rewstatic.com/img/rewLogoSized.png" width="149" height="38" alt="">
</div>
<?php padding(); ?>
<?php flushit(); ?>
<ul>
<li><a href="?">Home</a></li>
<li><a href="?about">About</a></li>
<li><a href="?contact">Contact</a></li>
</ul>
<?php padding(); ?>
<?php flushit(); ?>
</div>
<div id="content">
<?php
// Count to 50....
for ($i = 1; $i <= 50; $i++) {
echo $i . "\n";
delay();
}
?>
</div>
<div id="footer">
<p>&copy; <?=date('Y'); ?></p>
<p><a href="http://www.realestatewebmasters.com/" target="_blank">Real Estate Webmasters</a></p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment