<div class="gmail_quote">On Thu, Jun 25, 2009 at 3:42 PM, Ashish Tonse <span dir="ltr">&lt;<a href="mailto:ashish.tonse@gmail.com">ashish.tonse@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br></div><div>  I am currently working on implementing Seam on part of a relatively high traffic site (8k+ concurrent users) and optimizing our backend and frontend to handle that traffic. When focusing on front-end, I&#39;m trying to make sure that the right HTTP caching headers are sent out -- but our Seam Remoting javascript files can&#39;t be browser-cached for a couple of reasons:</div>

<div><br></div><div>  /interface.js?componentName won&#39;t get cached due to it containing a query string and the way browsers handle those</div><div>  /remote.js always returns an HTTP 200 with the actual file contents, whereas this file would only change with new Seam releases (is that correct?)</div>

<div><br></div><div>  Also, neither of these JS files are combined, packed or minified.</div></blockquote><div><br>Yep, you have identified one of the key optimizations that really needs to be addressed in Seam.<br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div></div><div><br></div><div>  The Seam Remoting InterfaceGenerator does have an interface cache for each component, so at least that time is saved. But it still sends back unnecessary unchanged content to the browser. Since javascript downloads block all other downloads in the browser, this is especially noticeable with load times, making the page seem slower.</div>

<div><br></div><div>  A good potential solution (suggested by Dan Allen on twitter) to the first issue... use the ReWrite filter. My guess would be something like this:</div><div><br></div><div>  /interface/componentName.js --&gt; interface.js?componentName</div>

<div><br></div><div>  And if we sent the right HTTP caching headers, that would fix that issue and browsers could cache it. But what about using multiple components? This is what I propose...</div><div><br></div><div>  /interface/componentName1,componentName2,componentName3.js -----&gt; /interface.js?componentName1,componentName2,componentName3</div>
</blockquote><div><br>Why not go with something a little more natural? Such as:<br><br>/seam/resource/componentName1/componentName2/componentName3/interface.js<br><br>I wonder if the extension is even necessary since the servlet is being matched using the /seam/resource/* pattern.<br>
<br>Christian and Jozef, any thoughts on the URL design here?<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><br></div><div>
  Is this something reasonable enough that I can take on as my first Seam contribution? (Seems small enough)... </div></blockquote><div><br>Sure thing. You have to start somewhere, right?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div></div>
<div><br></div><div>  Furthermore, in non-debug mode, Seam should send back minified Javascript (using the Java based YUI-compressor)</div></blockquote><div><br>Absolutely.<br><br>-Dan<br></div></div><br>-- <br>Dan Allen<br>
Senior Software Engineer, Red Hat | Author of Seam in Action<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br>
<br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>from my email. If you contact me, but don&#39;t hear back for more than a week,<br>
it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters.  Please don&#39;t hesitate to resend a message if<br>you feel that it did not reach my attention.<br>