Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
Hi, I made a new test (serving a png and a js) with current trunk and the gap is much smaller now: tomcat is 25% faster on average. Attila Attila can you elaborate on your tests? Are you comparing the difference between using a resource reference (js) and image component (png) in wicket vs linking straight the to the files in html? If so, what relevance does whether the static files are in META-INF or WEB-INF have? Not that much because if I am correct the extra overhead is introduced by having wicket process the resource and spit out the markup... Notice: This communication, including any attachments, is intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient, you are requested not to disclose, copy, distribute or take any action in reliance on the contents of this information.
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
2011/3/25 mzem...@osc.state.ny.us Hi, I made a new test (serving a png and a js) with current trunk and the gap is much smaller now: tomcat is 25% faster on average. Attila Attila can you elaborate on your tests? Are you comparing the difference between using a resource reference (js) and image component (png) in wicket vs linking straight the to the files in html? If so, what relevance does whether the static files are in META-INF or WEB-INF have? Not that much because if I am correct the extra overhead is introduced by having wicket process the resource and spit out the markup... Hi! In speed test I compared the serving time of the static resources directly (and not the rendering time of the url-s in the wicket page or the page itself). With jmeter I calculated the average time for serving 20k times the same resource trough Servlet 3.0 meta and trough wicket. Attila
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
2011/3/24 hok ivanvasi...@gmail.com 2. In the Servlet 3.0 specification it's possible to have static resources under META-INF/resources and I noticed that wicket has MetaInfStaticResourceReference, which is better for serving static resources. In my case for some components I have css files which are loaded like: response.renderCSSReference(new PackageResourceReference(getClass(), getClass().getSimpleName() + .css)); So, it should be better to move all those css files under META-INF/resources. However, this somehow contradicts with the wicket philosophy of having everything in one place and requires maintaining a parallel package folder structure under META-INF/resources. Do you think it's worth it? Hi, In my tests I found that Tomcat 7 serves static files from META-INF/resources directory 2-3 times faster than wicket. So if performance is important I think it is worth it. I am pragmatic about it: maybe it is bad to not hold everything in the same directory but this is a feature that fits wicket pretty well (bundling static files in jars) so it would be worse to not use it. Attila
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
Hi, On Thu, Mar 24, 2011 at 7:17 AM, Attila Király kiralyattila...@gmail.comwrote: 2011/3/24 hok ivanvasi...@gmail.com 2. In the Servlet 3.0 specification it's possible to have static resources under META-INF/resources and I noticed that wicket has MetaInfStaticResourceReference, which is better for serving static resources. In my case for some components I have css files which are loaded like: response.renderCSSReference(new PackageResourceReference(getClass(), getClass().getSimpleName() + .css)); So, it should be better to move all those css files under META-INF/resources. However, this somehow contradicts with the wicket philosophy of having everything in one place and requires maintaining a parallel package folder structure under META-INF/resources. Do you think it's worth it? Hi, In my tests I found that Tomcat 7 serves static files from META-INF/resources directory 2-3 times faster than wicket. So if performance is important I think it is worth it. I am pragmatic about it: maybe it is bad to not hold everything in the same directory but this is a feature that fits wicket pretty well (bundling static files in jars) so it would be worse to not use it. Attila With the new CachingResourceStreamLocator the serving should be faster now. See https://issues.apache.org/jira/browse/WICKET-3511. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
You can attach a front-end proxy like nginx or apache that caches resources delivered by your wicket application so subsequent requests will be served from the proxy cache with maximum speed. Am 24.03.2011 um 09:01 schrieb Martin Grigorov: Hi, On Thu, Mar 24, 2011 at 7:17 AM, Attila Király kiralyattila...@gmail.comwrote: 2011/3/24 hok ivanvasi...@gmail.com 2. In the Servlet 3.0 specification it's possible to have static resources under META-INF/resources and I noticed that wicket has MetaInfStaticResourceReference, which is better for serving static resources. In my case for some components I have css files which are loaded like: response.renderCSSReference(new PackageResourceReference(getClass(), getClass().getSimpleName() + .css)); So, it should be better to move all those css files under META-INF/resources. However, this somehow contradicts with the wicket philosophy of having everything in one place and requires maintaining a parallel package folder structure under META-INF/resources. Do you think it's worth it? Hi, In my tests I found that Tomcat 7 serves static files from META-INF/resources directory 2-3 times faster than wicket. So if performance is important I think it is worth it. I am pragmatic about it: maybe it is bad to not hold everything in the same directory but this is a feature that fits wicket pretty well (bundling static files in jars) so it would be worse to not use it. Attila With the new CachingResourceStreamLocator the serving should be faster now. See https://issues.apache.org/jira/browse/WICKET-3511. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
2011/3/24 Martin Grigorov mgrigo...@apache.org Hi, On Thu, Mar 24, 2011 at 7:17 AM, Attila Király kiralyattila...@gmail.com wrote: 2011/3/24 hok ivanvasi...@gmail.com 2. In the Servlet 3.0 specification it's possible to have static resources under META-INF/resources and I noticed that wicket has MetaInfStaticResourceReference, which is better for serving static resources. In my case for some components I have css files which are loaded like: response.renderCSSReference(new PackageResourceReference(getClass(), getClass().getSimpleName() + .css)); So, it should be better to move all those css files under META-INF/resources. However, this somehow contradicts with the wicket philosophy of having everything in one place and requires maintaining a parallel package folder structure under META-INF/resources. Do you think it's worth it? Hi, In my tests I found that Tomcat 7 serves static files from META-INF/resources directory 2-3 times faster than wicket. So if performance is important I think it is worth it. I am pragmatic about it: maybe it is bad to not hold everything in the same directory but this is a feature that fits wicket pretty well (bundling static files in jars) so it would be worse to not use it. Attila With the new CachingResourceStreamLocator the serving should be faster now. See https://issues.apache.org/jira/browse/WICKET-3511. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ Hi, I made a new test (serving a png and a js) with current trunk and the gap is much smaller now: tomcat is 25% faster on average. Attila
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
For development you can keep the resources in the usual, wicket preferred location (next to the class files), and when you package your jars you can instruct your build tool to move them to META-INF/resources Best of both worlds :) Martijn On Thu, Mar 24, 2011 at 7:17 AM, Attila Király kiralyattila...@gmail.com wrote: 2011/3/24 hok ivanvasi...@gmail.com 2. In the Servlet 3.0 specification it's possible to have static resources under META-INF/resources and I noticed that wicket has MetaInfStaticResourceReference, which is better for serving static resources. In my case for some components I have css files which are loaded like: response.renderCSSReference(new PackageResourceReference(getClass(), getClass().getSimpleName() + .css)); So, it should be better to move all those css files under META-INF/resources. However, this somehow contradicts with the wicket philosophy of having everything in one place and requires maintaining a parallel package folder structure under META-INF/resources. Do you think it's worth it? Hi, In my tests I found that Tomcat 7 serves static files from META-INF/resources directory 2-3 times faster than wicket. So if performance is important I think it is worth it. I am pragmatic about it: maybe it is bad to not hold everything in the same directory but this is a feature that fits wicket pretty well (bundling static files in jars) so it would be worse to not use it. Attila -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
Yes, but you would have to change how you refer to them, right? On Thu, Mar 24, 2011 at 6:33 AM, Martijn Dashorst martijn.dasho...@gmail.com wrote: For development you can keep the resources in the usual, wicket preferred location (next to the class files), and when you package your jars you can instruct your build tool to move them to META-INF/resources Best of both worlds :) Martijn On Thu, Mar 24, 2011 at 7:17 AM, Attila Király kiralyattila...@gmail.com wrote: 2011/3/24 hok ivanvasi...@gmail.com 2. In the Servlet 3.0 specification it's possible to have static resources under META-INF/resources and I noticed that wicket has MetaInfStaticResourceReference, which is better for serving static resources. In my case for some components I have css files which are loaded like: response.renderCSSReference(new PackageResourceReference(getClass(), getClass().getSimpleName() + .css)); So, it should be better to move all those css files under META-INF/resources. However, this somehow contradicts with the wicket philosophy of having everything in one place and requires maintaining a parallel package folder structure under META-INF/resources. Do you think it's worth it? Hi, In my tests I found that Tomcat 7 serves static files from META-INF/resources directory 2-3 times faster than wicket. So if performance is important I think it is worth it. I am pragmatic about it: maybe it is bad to not hold everything in the same directory but this is a feature that fits wicket pretty well (bundling static files in jars) so it would be worse to not use it. Attila -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
On Thu, Mar 24, 2011 at 12:02 PM, James Carman ja...@carmanconsulting.com wrote: Yes, but you would have to change how you refer to them, right? Not sure how that would work out, haven't tried it. Isn't this also a tomcat specific optimization as well? Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
On Thu, Mar 24, 2011 at 12:13 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: On Thu, Mar 24, 2011 at 12:02 PM, James Carman ja...@carmanconsulting.com wrote: Yes, but you would have to change how you refer to them, right? Not sure how that would work out, haven't tried it. Isn't this also a tomcat specific optimization as well? It is by Servlet 3.0 specification. My recent research shows that Wicket+Wro4j is the best approach. wro.xml: group name=style css/css/context.css/css cssclasspath:/com/mycompany/components/Component1.css/css cssclasspath:/com/mycompany/components/Component2.css/css cssclasspath:/com/mycompany/components/Component3.css/css /group Don't use ResourceReference but just put link rel=stylesheet href=wro/style.css/ in the page that uses these components. Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
looks like a refactoring-nightmare ... Am 24.03.2011 um 12:23 schrieb Martin Grigorov: On Thu, Mar 24, 2011 at 12:13 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: On Thu, Mar 24, 2011 at 12:02 PM, James Carman ja...@carmanconsulting.com wrote: Yes, but you would have to change how you refer to them, right? Not sure how that would work out, haven't tried it. Isn't this also a tomcat specific optimization as well? It is by Servlet 3.0 specification. My recent research shows that Wicket+Wro4j is the best approach. wro.xml: group name=style css/css/context.css/css cssclasspath:/com/mycompany/components/Component1.css/css cssclasspath:/com/mycompany/components/Component2.css/css cssclasspath:/com/mycompany/components/Component3.css/css /group Don't use ResourceReference but just put link rel=stylesheet href=wro/style.css/ in the page that uses these components. Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps
On Thu, Mar 24, 2011 at 2:19 PM, Peter Ertl pe...@gmx.org wrote: looks like a refactoring-nightmare ... Can you be more specific ? I even see it easier to manage. With wro.xml you have all resources specified in one place but in different groupd. With default Wicket approach you have a ResRef in every .java file that needs them. By refactoring I guess you mean renaming the .java class name or even moving the class in different package. The IDE wont help you here - it wont move the .css together with the .java, so you'll need to either touch the path in the ResRef or move the resource after the refactoring. Or I didn't understand you ? Am 24.03.2011 um 12:23 schrieb Martin Grigorov: On Thu, Mar 24, 2011 at 12:13 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: On Thu, Mar 24, 2011 at 12:02 PM, James Carman ja...@carmanconsulting.com wrote: Yes, but you would have to change how you refer to them, right? Not sure how that would work out, haven't tried it. Isn't this also a tomcat specific optimization as well? It is by Servlet 3.0 specification. My recent research shows that Wicket+Wro4j is the best approach. wro.xml: group name=style css/css/context.css/css cssclasspath:/com/mycompany/components/Component1.css/css cssclasspath:/com/mycompany/components/Component2.css/css cssclasspath:/com/mycompany/components/Component3.css/css /group Don't use ResourceReference but just put link rel=stylesheet href=wro/style.css/ in the page that uses these components. Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/