Tidy Output
Posted by Brian Moon
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
mod_tidy.php | 1.4 KB | open | download | Brian Moon | 10/29/2007 | Read message |
Tidy Output June 08, 2007 01:37AM |
Admin Registered: 23 years ago Posts: 4,495 |
This is a simple little module that I wrote based on some work I have done at dealnews to save some bytes here and there. We mainly use it to save bytes in our cache, but it saves bandwidth. For the forum list on this page, it saves 8k of just junk that is not needed for a browser to render the page.
Update: New version that does not kill pre and xmp tags. This version is included in the 5.2 code as of now.
Edited 1 time(s). Last edit at 10/29/2007 12:48AM by brianlmoon.
Update: New version that does not kill pre and xmp tags. This version is included in the 5.2 code as of now.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 1 time(s). Last edit at 10/29/2007 12:48AM by brianlmoon.
Re: Tidy Output July 23, 2007 05:50PM |
Registered: 18 years ago Posts: 110 |
Re: Tidy Output October 29, 2007 12:49AM |
Admin Registered: 23 years ago Posts: 4,495 |
See if the new version works for you. It uses output buffering and should not get messed up with ob_gzhandler as long as ob_gzhandler is called very very early in the code. Like, it should be the first thing called.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Tidy Output October 29, 2007 03:10AM |
Registered: 18 years ago Posts: 110 |
Quote
brianlmoon
See if the new version works for you. It uses output buffering and should not get messed up with ob_gzhandler as long as ob_gzhandler is called very very early in the code. Like, it should be the first thing called.
It's the VERY first thing called... and in firefox it provides a blank page.
I tried in in safari (on a pc) and got this:
Safari can’t open the page “[www.MYPHORUM.com]”. The error was: “unknown error” (CFURLErrorDomain:-1011) Please choose Report Bugs to Apple from the Help menu, note the error number, and describe what you did before you saw this message.
I'll just assume it's some other module causing a problem. for now, I'm just going to keep it off.
Re: Tidy Output October 29, 2007 01:17PM |
Admin Registered: 23 years ago Posts: 4,495 |
honestly, if you are using ob_gzhandler, this module is not really useful anyway. gz will cut out the empty space when it compresses.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Tidy Output November 07, 2007 02:37AM |
Registered: 18 years ago Posts: 110 |
yes, but only with browsers which support gzipped data, so it's still a niceity, but it might be more of a resource saving to just run a tidy on the templates and call it a day, if my phorums got more traffic I'd stress over it, but no ones really complained about speed and bandwidth hasn't beena problem.Quote
brianlmoon
honestly, if you are using ob_gzhandler, this module is not really useful anyway. gz will cut out the empty space when it compresses.
Re: Tidy Output November 07, 2007 05:20AM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Tidy Output December 06, 2007 01:29PM |
Registered: 20 years ago Posts: 237 |
I was using this module until I discovered an unintended? side effect:
When editing or previewing a message that has "code", all of the extra whitespace is stripped out in the new edit box. Leading spaces, as well as spaces in the middle.
Disabling the module solves the problem, but perhaps there is another fix?
When editing or previewing a message that has "code", all of the extra whitespace is stripped out in the new edit box. Leading spaces, as well as spaces in the middle.
this is <- this gets shifted over as well the sort of thing I'm talking about
Disabling the module solves the problem, but perhaps there is another fix?
Re: Tidy Output December 06, 2007 01:30PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Tidy Output May 01, 2008 03:53PM |
Registered: 16 years ago Posts: 9 |
Sorry, only registered users may post in this forum.