2009-01-30 08:56 |
yuri
Yuri Takhteyev < <yuri at sims.berkeley.edu>
To further follow YSlow advice, I decided to consolidate all default css and js one file each. So, sputnik/css/layout, sputnik/css/colors and sputnik/css/yui_reset have been merged into sputnik/styles.css. The actual source of yui_reset has been moved into a module (sputnik.util.yui_reset), under the assumption that you won't need to edit it. It's inserted in the style sheet in place of $reset_code, so you can easily get rid of YUI. Similarly, there is now a single java script files used by default: sputnik/scripts.js. This page includes jquery, now stored in sputnik.util.jquery and inserted in place of $jquery). It also includes the JS that used to be in the body of the page. There are now no JS function definitions in the body. Again, you can remove jquery by editing sputnik/scripts. However, the current assumption is that jquery is available on all pages and is loaded before any other JS. I also took the opportunity to reformat the HTML and make it a little neater. Finally, I added an option of serving 'static' elements such as CSS, JS, and standard icons from a different server. There are now three new paramers: ICON_BASE_URL, CSS_BASE_URL and JS_BASE_URL. If set, those will be used instead of NICE_URL for common icons, css, and js. This makes it possible to just save them as files and to let another server serve them. (Note that you can still edit those through Sputnik and just wget them into your static directory.) It tried this on spu.tnik.org, letting Apache serve those files, and it seemed to give me a noticeable reduction in loading time for the first page view - about 30% I would say. (This requires properly configured Apache - with mod_deflate and mod_expires.) - yuri -- http://spu.tnik.org/ _______________________________________________ Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-01-30 08:56 |
jnwhiteh
Jim Whitehead II < <jnwhiteh at gmail.com>
On Thu, Jan 29, 2009 at 4:07 AM, Yuri Takhteyev <yuri@sims.berkeley.edu> wrote: > To further follow YSlow advice, I decided to consolidate all default > css and js one file each. > > So, sputnik/css/layout, sputnik/css/colors and sputnik/css/yui_reset > have been merged into sputnik/styles.css. The actual source of > yui_reset has been moved into a module (sputnik.util.yui_reset), under > the assumption that you won't need to edit it. It's inserted in the > style sheet in place of $reset_code, so you can easily get rid of YUI. > > Similarly, there is now a single java script files used by default: > sputnik/scripts.js. This page includes jquery, now stored in > sputnik.util.jquery and inserted in place of $jquery). It also > includes the JS that used to be in the body of the page. There are now > no JS function definitions in the body. Again, you can remove jquery > by editing sputnik/scripts. However, the current assumption is that > jquery is available on all pages and is loaded before any other JS. I have to say that I disagree with these changes to the core. This is all well and good when you are pumping out a large number of requests in a production site but they make development more difficult. Why are we prematurely optimizing parts of the code that people are expected to change? There's a reason that JQuery is packed in the way it is before it's shipped out, because it provides speedup, however no one is trying to edit JQuery. It is reasonable and expected that the user will want to edit main javascript on the site, as well as the core CSS. I would hope to see this change reverted. Anyone who wants to make the change can easily do so themselves, can they not? > I also took the opportunity to reformat the HTML and make it a little neater. No objections here whatsoever. > Finally, I added an option of serving 'static' elements such as CSS, > JS, and standard icons from a different server. There are now three > new paramers: ICON_BASE_URL, CSS_BASE_URL and JS_BASE_URL. If set, > those will be used instead of NICE_URL for common icons, css, and js. > This makes it possible to just save them as files and to let another > server serve them. (Note that you can still edit those through Sputnik > and just wget them into your static directory.) It tried this on > spu.tnik.org, letting Apache serve those files, and it seemed to give > me a noticeable reduction in loading time for the first page view - > about 30% I would say. (This requires properly configured Apache - > with mod_deflate and mod_expires.) Again, no objections. _______________________________________________ Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-01-30 08:56 |
yuri
Yuri Takhteyev < <yuri at sims.berkeley.edu>
> one is trying to edit JQuery. It is reasonable and expected that the > user will want to edit main javascript on the site, as well as the > core CSS. I would hope to see this change reverted. Anyone who wants > to make the change can easily do so themselves, can they not? They _can_ edit it. The only differences are: 1. What used to be two user-editable CSS nodes (sputnik/colors) and (sputnik/layout) is now one - sputnik/style. This just makes it simpler. Earlier, I found that I often had to go and edit both colors and layout to make a simple changes, and ended up putting color configuration in layout or vice versa. The single node is just as editable as the two nodes were. If we really want to break the stylesheet up into smaller parts, we would be better off making them sections in the same node. 2. yui_reset is inserted into the same style sheet dynamically. The user can no longer edit the yui_reset CSS code, but it's wasn't really editable anyway (it was minified). The user _can_ trivially get rid of yui_reset by removing "$reset_code" from the top of the stylesheet node. I am not sure why this would make it any harder to customize stylesheets than it was before. You can still add more stylesheets for specific nodes. It's not that all nodes must now share the same single stylesheet. It's just that earlier every node defaulted to the same three files. Now they default to the same _one_. If some nodes want to have two or three, they can. The same with JS. Before we references an external stylesheet for JQuery and had a few small chunks of JS in the body. Now all of this is in sputnik/scripts. I think this makes it _easier_ for the user to edit JS. And you can still add more JS to specific nodes. Does this help? - yuri -- http://spu.tnik.org/ _______________________________________________ Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-01-30 08:56 |
jnwhiteh
Jim Whitehead II < <jnwhiteh at gmail.com>
On Thu, Jan 29, 2009 at 9:12 AM, Yuri Takhteyev <yuri@sims.berkeley.edu> wrote: >> one is trying to edit JQuery. It is reasonable and expected that the >> user will want to edit main javascript on the site, as well as the >> core CSS. I would hope to see this change reverted. Anyone who wants >> to make the change can easily do so themselves, can they not? > > They _can_ edit it. The only differences are: > > 1. What used to be two user-editable CSS nodes (sputnik/colors) and > (sputnik/layout) is now one - sputnik/style. This just makes it > simpler. Earlier, I found that I often had to go and edit both colors > and layout to make a simple changes, and ended up putting color > configuration in layout or vice versa. The single node is just as > editable as the two nodes were. If we really want to break the > stylesheet up into smaller parts, we would be better off making them > sections in the same node. Okay, I'm sorry I misunderstood what change was being made here specifically. I probably should have looked at the actual changes rather than your prose, since it would have been more specific. > 2. yui_reset is inserted into the same style sheet dynamically. The > user can no longer edit the yui_reset CSS code, but it's wasn't really > editable anyway (it was minified). The user _can_ trivially get rid of > yui_reset by removing "$reset_code" from the top of the stylesheet > node. Okay, I thought you were throwing everything together into one big file, this makes much more sense. > I am not sure why this would make it any harder to customize > stylesheets than it was before. You can still add more stylesheets for > specific nodes. It's not that all nodes must now share the same single > stylesheet. It's just that earlier every node defaulted to the same > three files. Now they default to the same _one_. If some nodes want to > have two or three, they can. > > The same with JS. Before we references an external stylesheet for > JQuery and had a few small chunks of JS in the body. Now all of this > is in sputnik/scripts. I think this makes it _easier_ for the user to > edit JS. And you can still add more JS to specific nodes. I'm still not totally wild about this one, but again much more acceptable than was I had thought was the case. Sorry for the noise. > > Does this help? > > - yuri > > -- > http://spu.tnik.org/ > _______________________________________________ Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-01-30 08:56 |
yuri
Yuri Takhteyev < <yuri at sims.berkeley.edu>
I am glad we are on the same page now. > Okay, I thought you were throwing everything together into one big > file, this makes much more sense. I did consider this briefly, but decided against it. It's possible to do it so that it's still easy to edit JS, but it gets more complicated. Also, making CSS and JS external allows for substantial savings for later requests because of caching. >> JQuery and had a few small chunks of JS in the body. Now all of this >> is in sputnik/scripts. I think this makes it _easier_ for the user to >> edit JS. And you can still add more JS to specific nodes. > > I'm still not totally wild about this one, but again much more > acceptable than was I had thought was the case. Any particular concerns? Should I assume that you wouldn't be wild about CSS sprites either? :) - yuri -- http://spu.tnik.org/ _______________________________________________ Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-02-01 02:44 |
carregal
Andre Carregal < <carregal at fabricadigital.com.br>
On Fri, Jan 30, 2009 at 6:38 AM, Yuri Takhteyev <yuri@sims.berkeley.edu> wr=
ote:
> Should I assume that you wouldn't be wild about CSS sprites either? :)
Please leave that to spritenick, the next incarnation of a
collaborative web based animation framework... :o)
Andr=E9
_______________________________________________
Sputnik-list mailing list
Sputnik-list@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list