I think there's a confusion here about what Sumanth means by "server
requests". The term is ambiguous in the context of his/her e-mail and I
answered considering them as database and web services requests.
On Sun, 17 Aug 2014 00:48:56 -0300, Geoff Callender
<geoff.callender.jumpst...@gmail.com> wrote:
Sumanth,
I think there will be much fewer requests than you imagine. Have a look
at the network traffic (use your browser's web inspector or FireBug) to
see for yourself.
* If you click a link generated by PageLink, then you should see exactly
*one* request and an HTTP 200 (OK) response which contains the whole
page including the layout.
* If you click a link generated by EventLink, then you should see
exactly *two* requests: the first one will respond with an HTTP 302
(REDIRECT) response and the second will respond with an HTTP 200 (OK)
response which contains the whole page including the layout.
Of course there may be other requests for assets (css, js, images, etc),
but the ones in your layout will be cached automatically (when in
production mode).
An alternative technique is to use a single page, with layout, for the
whole app and use Ajax/Zone updates to replace everything except the
layout portion.
HTH,
Geoff
On 17 Aug 2014, at 12:20 pm, Thiago H de Paula Figueiredo
<thiag...@gmail.com> wrote:
On Sat, 16 Aug 2014 21:43:09 -0300, Sumanth <roasteddra...@gmail.com>
wrote:
Hi Tapestry Gurus,
Hi!
I'm working on a project where there is a layout component. I have
certain
other components which are part of this layout for example user login,
messages from other user (equivalent to facebook top bar). Now if the
user has permissions then these compnents are made visible . The
problem I'm
facing is on each and every page load/ new page, the layout is
reloading
making server calls to render the compoents. For example if on the left
I've links to other pages like dashboard and reports, when I click from
home page to dashboard , the layout components are reloading making
server calls and re-rendering.
Cache the results of the server calls to have better performance. It's
not even specific to Tapestry: you'd do this in any framework.
So my question is, Is it possible to keep these components as part of
the
layout but prevent un-necessary server calls when I traverse to other
pages
I'm not sure what you mean by unnecessary server calls. Tapestry by
itself won't cause any unnecessary server call. It just render
components and trigger events. Your code that handle that is the one
doing server calls. They're calls in your code, so you're the one who
know better than anyone what calls are unnecessary and which ones are
can be cached.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org