CakePHP Remove Time Printout On AJAX

One of the projects I’m working on at work has a load of this scattered around the codebase for AJAX, which really grates on me:

Configure::write('debug', 0);

This is all because of the little ‘helpful’ comment that Cake puts at the bottom of all your rendered view that tells you how long it took. So if you’ve got some JSON coming back, you get:

{foo: bar, bar: foo}<!-- 0.01s -->

Which is incredibly annoying. Well, I found the culprit - right at the bottom of app/webroot/index.php, just get rid of these lines:

if (Configure::read() > 0){
    echo "<!-- " .round(getMicrotime() - $TIME_START, 4) . "s -->";

Please, lets stop writing configuration changes in our action code, and start deleting this little thing so we don’t have to worry about it.