For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > November 2004 > can we save considerable bandwidth with tidy *and smarty* as well ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author can we save considerable bandwidth with tidy *and smarty* as well ?
Valerie Delon

2004-11-21, 3:59 pm

I'm so excited after reading Mr. John's 2004 PHP Quebec Conference
Session about Tidy. I want to use tidy function special for my Smarty
template . Can I ?


Val=E9rie Delon
=E9tudiante

--
On a besoin d'apprendre beacoup plus
Quelqu'un croit c'est trop
Mais j'crois que ce n'est pas assez



<?php

$opts =3D array("clean" =3D> true,
"drop-proprietary-attributes" =3D> true,
"drop-font-tags" =3D> true,
"drop-empty-paras" =3D> true,
"hide-comments" =3D> true,
"join-classes" =3D> true,
"join-styles" =3D> true);

$tidy =3D tidy_parse_file("php.html", $opts);
tidy_clean_repair($tidy);

echo $tidy;
?>

-rw-rw-r-- 1 john john 27066 Jan 3 04:11 php.html
-rw-rw-r-- 1 john john 26193 Jan 3 04:11 php_tidy.html

Without losing maintainability, tidy has saved 873 bytes per request
That might not seem like a lot, but when you serve 100,000 hits a day you
save 87.3 megabytes a day in bandwidth.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com