Skip to content

Proposal to add PageGen time to each page #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Willtech opened this issue Sep 3, 2021 · 8 comments
Closed

Proposal to add PageGen time to each page #440

Willtech opened this issue Sep 3, 2021 · 8 comments

Comments

@Willtech
Copy link

Willtech commented Sep 3, 2021

For various reasons including search indexing and server performance include PageGen time in the footer of each generated page.

@Willtech
Copy link
Author

Willtech commented Sep 3, 2021

UPdate footer creation as follows:

<footer>
<div class="container footer-content">
<div class="row-fluid">
<ul class="footmenu">
<li><a href="/copyright.php">Copyright &copy; 2001-2021 The PHP Group</a></li>
<li><a href="/my.php">My PHP.net</a></li>
<li><a href="/contact.php">Contact</a></li>
<li><a href="/sites.php">Other PHP.net sites</a></li>
<li><a href="/privacy.php">Privacy policy</a></li>
<li><a href="https://github.com/php/web-php/blob/master/manual%2Fen%2Ffunction.random-inc.php">View Source</a></li>
<li>(PageGen 0.736984 Seconds)</li>
</ul>
</div>
</div>
</footer>

@Willtech
Copy link
Author

Willtech commented Sep 3, 2021

In every file (unless it can be batched with included)
At the beginning of the page generation

//PageGen
$tt = microtime(true);

And, at the conclusion of the page generation, as practical as possible,

<li>(PageGen <?php $tt = number_format(rtrim(sprintf("%.20f", (microtime(true) - $tt)), "0"),6,'.',',');
echo $tt; ?> Seconds)</li>

@Willtech
Copy link
Author

Willtech commented Sep 3, 2021

Ideally, this would have six decimal places if less than one second, and two decimals if more than one second.

@Willtech
Copy link
Author

Willtech commented Sep 3, 2021

Or, usiung the new method place this code as near as practical to the conclusion of page generation.

<li>(PageGen <?php $tt = number_format(rtrim(sprintf("%.20f", (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'])), "0"),6,'.',',');
                     if (strpos(($tt."0"), "0") != 0) {
                         $tt = number_format($tt,2,'.',',');
                     }
                     echo $tt; ?> Seconds)</li>

@cmb69
Copy link
Member

cmb69 commented Sep 3, 2021

Why? Are there any other popular sites which still do this?

@salathe
Copy link
Contributor

salathe commented Sep 3, 2021

No, thanks.

@salathe salathe closed this as completed Sep 3, 2021
@Willtech
Copy link
Author

Willtech commented Sep 3, 2021

Why? Are there any other popular sites which still do this?

Sure, but if there are more front page results. This site had #1 position sometimes and front page always.
Archive:www.willtech.com.au/shop/

We had these sorts of products here also with ESET

@kelunik
Copy link
Member

kelunik commented Sep 3, 2021

I also don't see a good reason to expose page timings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants