[web2py] Re: minifying the view

2013-08-02 Thread Niphlod
yep. as a total offtopic (but related) real-world scenario, in 2013 all the cpu power that a server provides can be (and I strongly believe it **must** be) used to gzip the page: in such case minifying the HTML has very little impact (if no impact at all) in the loading speed of a page. On Frid

[web2py] Re: minifying the view

2013-08-02 Thread Anthony
Every line with a {{...}} (that doesn't start with "=") results in a blank line being written to the view output. To avoid that, you have to move all {{...}} code onto lines that generate output so you don't get any extraneous blank lines. For example, the code generating all the whitespace you

[web2py] Re: minifying the view

2013-08-02 Thread Mark Finkelstein
Well an example would be the default page that appears in web2py (reached by, for example, http://127.0.0.1:8000/welcome/default/index), there is a large amount of spaces in there that needlessly inflate the file; in that file, for example, there is this: Hello World How did you get here?

[web2py] Re: minifying the view

2013-08-01 Thread Anthony
You could put more template code and HTML onto a single line rather than on separate lines, though that will result in less readable/maintainable templates. Can you show a specific example of (a) some template code, (b) the HTML it generates, and (c) the HTML you would prefer to see instead? An

[web2py] Re: minifying the view

2013-08-01 Thread Mark Finkelstein
Sure; instead of calling minify dynamically, which would take extra computation, I was wondering if there was a better way so that the excess spaces do not appear to begin with (by minifying the actual view python file in a way). Also, thanks for being a great help on this forum. On Thursday, A

[web2py] Re: minifying the view

2013-08-01 Thread Anthony
Can you give an example of what you are trying to achieve? On Thursday, August 1, 2013 9:14:41 PM UTC-4, Mark Finkelstein wrote: > > I actually meant minifying the view py file itself to remove the spaces > where they would have been produced? > > On Thursday, August 1, 2013 6:39:52 PM UTC-4, Ant

[web2py] Re: minifying the view

2013-08-01 Thread Mark Finkelstein
I actually meant minifying the view py file itself to remove the spaces where they would have been produced? On Thursday, August 1, 2013 6:39:52 PM UTC-4, Anthony wrote: > > I think something like: > > from gluon.contrib.minify import htmlmin > > def myaction(): > ... > return htmlmin.min

[web2py] Re: minifying the view

2013-08-01 Thread Anthony
I think something like: from gluon.contrib.minify import htmlmin def myaction(): ... return htmlmin.minify(response.render(dict(...))) Anthony On Thursday, August 1, 2013 5:57:51 PM UTC-4, Mark Finkelstein wrote: > > I noticed that as it stands, the html response sent is filled with spa