You may get better responses on the Mako list rather than Pylons,
but without further details I suspect there are a couple things you
may want to do.
First, when you write your templates be aware of where you may
be inadvertently introducing whitespace. Make use of the end-of-line
backslash syntax to suppress extra line breaks, especially when
ending a Mako block. Rather than
Some text
<%
some python code
%>
more text.
Do something like this:
Some text\
<%
some python code
%>\
more text.
Also don't insert unnecessary blank lines if you don't need them,
instead just insert a blank Mako comment line: ##
Secondly, if you want to remove some whitespace by passing the
output through a function prior to caching you may want to use
Mako's filter mechanism. It already has a built-in filter to strip
whitespace at the beginning and end. If you want something more
sophisticated you can provide your own filtering function. Read up
on Mako's filters:
http://www.makotemplates.org/docs/filtering.html
If you have a more specific example that may help to answer
your question.
--
Deron Meranda
http://deron.meranda.us/