Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-30 08:58:12

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

[request] Wipe html-comments, new line symbols, tabs from output

I manually wipped all comments, newline symbols and tabs from from one of pages, which textpattern generates. It makes 20% saving of pages code size. Can be there plugin with such functions? May this feature can be implemented in asy_jpcahe?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#2 2008-03-30 14:56:41

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: [request] Wipe html-comments, new line symbols, tabs from output

Here’s what I came up with:

<txp:jmd_trim>
   <my_html>
   <txp:some_tag/>
</txp:jmd_trim>
# jmd_trim v0.1
# Strips whitespace and HTML comments.
# Jon-Michael Deldin
# http://jmdeldin.com/

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................

H4sIAAAAAAAAA6WSy1LCMBSG1+QpYoYFOJTeuJkiKxeOIyvdiTIhPdA6TdJJUtAB3t20FkfX 
LjJzLv/5zmXCaBjQo6FTSvagTa4kSQyNKQmGYW1NKGGVzZSunXBGyYOS3jLnGYMC30GR5k2B 
g7S6daXzOhK5SGZtSX3/XaSNcMiV8Bt1SEkKhuu8tJeOrtGTdQGDD1luwZSMA2YyxffPy0fs 
KgVIa4a1dkSJ/SyBJDkNvl3JBNQZN59rtnYc0QozKMrGdAtu+BDP7UdJL5oF6jT+RqWf/gLN 
/T/JlsBV2rDDqXOQ72MNQu3B4MyK4mewZtRfk2+1Ephh40hyh7aV5PWm+ALvdZm1ZoC7NnP5 
PjqiTldVFt9i0LDL1xrKwmF6ZCVPK31a2dP8yvNe3hav1563IANM3CuZNtBrEf0EoY4GW2mJ 
a1SCzqg9SX2DtWaHf9zBfQiRjhsromQGUczZBCbj7WY8YfGIz6ZTHkZxHARsBDckOX8BNCTu 
fFgCAAA=

Offline

#3 2008-03-30 15:14:16

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [request] Wipe html-comments, new line symbols, tabs from output

Victor are you sending those pages compressed (gzip) or not compressed? Compressing pages is usually more effective than cleaning up newlines, whitespace and comments and much simpler, because some whitespace/newlines are relevant (for example in <pre></pre> blocks).

Offline

Board footer

Powered by FluxBB