Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[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
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
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