You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bo Gao <el...@gmail.com> on 2012/01/05 06:05:54 UTC

The best way to use Stacks to combine css and javascript?

I want to use stacks to combine many small Css and Javascript to reduce HTTP requests.
I see tapestry use this to combine many javascript files into a core.js.

I have 2 pages for example:

page1 depends on 1.css, 2.css
page2 depends on 2.css, 3.css

If I want to minimize HTTP request on these pages, what's the best way to create stacks?
In my thought, I create page1stack.java to combine 1.css and 2.css, and page2stack.java to combine 2.css and 3.css.
But I think it's not easy to use. I must create many stacks. Is there another better way to use stack?

Thanks.


--
Bo Gao
elivoa@gmail.com







Re: The best way to use Stacks to combine css and javascript?

Posted by Bo Gao <el...@gmail.com>.
> Would it be possible to put all three in one stack, or does 1.css and
> 3.css have conflicting rules?

> I think the intended use of the stack functionality was to make an all
> (or mostly) inclusive one for your entire app/library and re-use it in
> many places; the rationale being that the savings in number of
> requests (and the corresponding overhead) outweighs the slight
> increase in size.

But 3.css is not used in page1, what if 3.css is very big, it's also a waste of bandwidth.
Put who and who together? There is no clearly rule to follow.

What's the best practice of using stacks?

On Jan 5, 2012, at 2:41 PM, Bo Gao wrote:

>> Would it be possible to put all three in one stack, or does 1.css and
>> 3.css have conflicting rules?
> 
>> I think the intended use of the stack functionality was to make an all
>> (or mostly) inclusive one for your entire app/library and re-use it in
>> many places; the rationale being that the savings in number of
>> requests (and the corresponding overhead) outweighs the slight
>> increase in size.
> 
> But 3.css is not used in page1, what if 3.css is very big, it's also a waste of bandwidth.
> Put who and who together? There is no clearly rule to follow.
> 
> 
> On Jan 5, 2012, at 1:52 PM, robert baker wrote:
> 
>> Would it be possible to put all three in one stack, or does 1.css and
>> 3.css have conflicting rules?
>> 
>> I think the intended use of the stack functionality was to make an all
>> (or mostly) inclusive one for your entire app/library and re-use it in
>> many places; the rationale being that the savings in number of
>> requests (and the corresponding overhead) outweighs the slight
>> increase in size.
>> 
>> 
>> On Thu, Jan 5, 2012 at 12:05 AM, Bo Gao <el...@gmail.com> wrote:
>>> I want to use stacks to combine many small Css and Javascript to reduce HTTP requests.
>>> I see tapestry use this to combine many javascript files into a core.js.
>>> 
>>> I have 2 pages for example:
>>> 
>>> page1 depends on 1.css, 2.css
>>> page2 depends on 2.css, 3.css
>>> 
>>> If I want to minimize HTTP request on these pages, what's the best way to create stacks?
>>> In my thought, I create page1stack.java to combine 1.css and 2.css, and page2stack.java to combine 2.css and 3.css.
>>> But I think it's not easy to use. I must create many stacks. Is there another better way to use stack?
>>> 
>>> Thanks.
>>> 
>>> 
>>> --
>>> Bo Gao
>>> elivoa@gmail.com
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
> 
> --
> Bo Gao
> elivoa@gmail.com
> 
> 
> 
> 
> 
> 

--
Bo Gao
elivoa@gmail.com







Re: The best way to use Stacks to combine css and javascript?

Posted by Bo Gao <el...@gmail.com>.
> Would it be possible to put all three in one stack, or does 1.css and
> 3.css have conflicting rules?

> I think the intended use of the stack functionality was to make an all
> (or mostly) inclusive one for your entire app/library and re-use it in
> many places; the rationale being that the savings in number of
> requests (and the corresponding overhead) outweighs the slight
> increase in size.

But 3.css is not used in page1, what if 3.css is very big, it's also a waste of bandwidth.
Put who and who together? There is no clearly rule to follow.


On Jan 5, 2012, at 1:52 PM, robert baker wrote:

> Would it be possible to put all three in one stack, or does 1.css and
> 3.css have conflicting rules?
> 
> I think the intended use of the stack functionality was to make an all
> (or mostly) inclusive one for your entire app/library and re-use it in
> many places; the rationale being that the savings in number of
> requests (and the corresponding overhead) outweighs the slight
> increase in size.
> 
> 
> On Thu, Jan 5, 2012 at 12:05 AM, Bo Gao <el...@gmail.com> wrote:
>> I want to use stacks to combine many small Css and Javascript to reduce HTTP requests.
>> I see tapestry use this to combine many javascript files into a core.js.
>> 
>> I have 2 pages for example:
>> 
>> page1 depends on 1.css, 2.css
>> page2 depends on 2.css, 3.css
>> 
>> If I want to minimize HTTP request on these pages, what's the best way to create stacks?
>> In my thought, I create page1stack.java to combine 1.css and 2.css, and page2stack.java to combine 2.css and 3.css.
>> But I think it's not easy to use. I must create many stacks. Is there another better way to use stack?
>> 
>> Thanks.
>> 
>> 
>> --
>> Bo Gao
>> elivoa@gmail.com
>> 
>> 
>> 
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

--
Bo Gao
elivoa@gmail.com







Re: The best way to use Stacks to combine css and javascript?

Posted by robert baker <le...@gmail.com>.
Would it be possible to put all three in one stack, or does 1.css and
3.css have conflicting rules?

I think the intended use of the stack functionality was to make an all
(or mostly) inclusive one for your entire app/library and re-use it in
many places; the rationale being that the savings in number of
requests (and the corresponding overhead) outweighs the slight
increase in size.


On Thu, Jan 5, 2012 at 12:05 AM, Bo Gao <el...@gmail.com> wrote:
> I want to use stacks to combine many small Css and Javascript to reduce HTTP requests.
> I see tapestry use this to combine many javascript files into a core.js.
>
> I have 2 pages for example:
>
> page1 depends on 1.css, 2.css
> page2 depends on 2.css, 3.css
>
> If I want to minimize HTTP request on these pages, what's the best way to create stacks?
> In my thought, I create page1stack.java to combine 1.css and 2.css, and page2stack.java to combine 2.css and 3.css.
> But I think it's not easy to use. I must create many stacks. Is there another better way to use stack?
>
> Thanks.
>
>
> --
> Bo Gao
> elivoa@gmail.com
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org