News for hackers. Stuff that matters.
Re:Modern Web Application Architecture by elisee on Saturday November 05, 2011 @01:35PM (#3200309)
Well in my case I wrote a little packer / minifier for compiled Jade (http://jade-lang.com/) templates and serve them as a single JavaScript file.

When you have different templates based on user rights, you should probably make different packed template files and serve them only to users with the proper cookie / session rights.

I'd serve an admin page / app at a specific URL and then it would reference the proper template JS file (or whatever you're using).

Either way I wouldn't worry about the extra few bytes served for rarely used templates, just make sure the template file is properly cached. Or serve it as a different file and load it asynchronously when needed.

Re:Modern Web Application Architecture by elisee on Sunday November 06, 2011 @07:38AM (#3202508)
If anyone's interested, I put up the code I wrote for packing Jade templates into a single file and serving them to the client with Express: http://pastebin.com/kRtCJHYH (feel free to do whatever you want with it)

I found there were very few good alternatives for using Jade template client-side. The only one that seems promising is JadeVu (https://github.com/LearnBoost/jadevu/) but the approach is very different.

Re:Modern Web Application Architecture by swah on Saturday November 05, 2011 @01:49PM (#3200359)
Oh yes, its not the page size I worry about, but whether the template already has some info that you don't want to share (OK, probably most interesting info is dynamic, but anyway)