Categories > TinyButStrong general >

Compressing HTML

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: RwD
Date: 2005-05-30
Time: 11:34

Compressing HTML

Since tbs is managing the output (of everything I build today) I was wondering if it could also before outputting remove all double spaces excluding <pre> elements and using a different space remove algorithm for <scipt> content.

The reason I need it is just to make it harder to simply copy what I did. The few spaces removed don't change a lot for the bandwith...

My guess is the feature will not make it into tbs as some othe solutions are available, but I was curious for an opinion on where tbs stands in this story.
By: Skrol29
Date: 2005-05-30
Time: 15:56

Re: Compressing HTML

Hi Rwd,

My point of view is that all Html analysis should not be the job of the Template Egine. Even if TBS has fiew specialized Html features (parameter 'select', keep '<body>' part when include file,...). Your intersting feature could be done by a single PHP function called by the user before the $TBS->Show() method.

Nevertheless, I'm studying a solution for implementing plug-ins to TinyButStrong. Your need is a nice example of a feature that could be added to TBS by plug-ins.
By: RwD
Date: 2005-06-01
Time: 09:24

Re: Compressing HTML

Plugins sounds nice.

By the way, the compression I talk about should strip everything that does not display or is not used by the client. So more then one white-space outside pre elements, textarea's and outside strings inside script elements. But also comments.

The end result might be one single line of text.