You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Blower, Andy" <An...@proquest.co.uk> on 2009/07/05 14:52:04 UTC

Need help with tricky T5 URL / onPassivate problem

I've been investigating and optimising performance of a search results page in our T5 app. The page needs to have a bookmarkable URL which will work without requiring any session information, so it can be used long after the session has expired. This necessitates putting the user's query in the URL which is then encoded and ends up as a very long string that becomes part of all results page URLs. If the session is present then it's ignored, and it's entirely optional - the page works fine with the query part of the URL removed, as long as the session is present and the query & results don't need re-generating.

The downside to this is that every URL for this page has this large query object encoded into it, which is not a problem for render URLs since that will end up in the browsers location bar and potentially get bookmarked by the users, so we want this optional large query object to be present. On the other hand, event URLs also have this large query object as part of them, even though it is completely unnecessary (if the user clicks on a link when the session has timed out they will get a session ended page) and is never used. This has been manageable while there were not many event links on the page, but over time they have increased and now event links on the results page are weighing in at over a megabyte!

What I want to do is only return the optional large query object when passivating for render URLs and not for event link URLs, but I can't figure out a way of doing this without hacking at T5 internals or making a special case for generation of links to this page. (I'd rather not do either)

So, am I missing something, is there a way of doing this in onPassivate() that anyone can think of?

Does anyone else think that this is a feature worth having in Tapestry, so that external URLs can have extra bits that internal (event) URLs don't need?

Thanks,

Andy.

RE: Need help with tricky T5 URL / onPassivate problem

Posted by "Blower, Andy" <An...@proquest.co.uk>.
That is an option that we considered, although the requirement is that they'll always work so we'd be storing a lot of information that will never get used. I take it that there's no way of doing what I want in onPassivate at the moment then? Looking at Tapestry code I couldn't see anything, but it's good to have confirmation.

> -----Original Message-----
> From: Howard Lewis Ship [mailto:hlship@gmail.com]
> Sent: 05 July 2009 17:33
> To: Tapestry users
> Subject: Re: Need help with tricky T5 URL / onPassivate problem
> 
> How many query objects will there be?  You could store them in the
> database
> and just encode a primary key into the URL.  Add a little bit to ensure
> people can't use other's queries, and that they get janitored if not
> used
> over some space of time, and you're in business.
> 
> On Sun, Jul 5, 2009 at 5:52 AM, Blower, Andy
> <An...@proquest.co.uk>wrote:
> 
> > I've been investigating and optimising performance of a search
> results page
> > in our T5 app. The page needs to have a bookmarkable URL which will
> work
> > without requiring any session information, so it can be used long
> after the
> > session has expired. This necessitates putting the user's query in
> the URL
> > which is then encoded and ends up as a very long string that becomes
> part of
> > all results page URLs. If the session is present then it's ignored,
> and it's
> > entirely optional - the page works fine with the query part of the
> URL
> > removed, as long as the session is present and the query & results
> don't
> > need re-generating.
> >
> > The downside to this is that every URL for this page has this large
> query
> > object encoded into it, which is not a problem for render URLs since
> that
> > will end up in the browsers location bar and potentially get
> bookmarked by
> > the users, so we want this optional large query object to be present.
> On the
> > other hand, event URLs also have this large query object as part of
> them,
> > even though it is completely unnecessary (if the user clicks on a
> link when
> > the session has timed out they will get a session ended page) and is
> never
> > used. This has been manageable while there were not many event links
> on the
> > page, but over time they have increased and now event links on the
> results
> > page are weighing in at over a megabyte!
> >
> > What I want to do is only return the optional large query object when
> > passivating for render URLs and not for event link URLs, but I can't
> figure
> > out a way of doing this without hacking at T5 internals or making a
> special
> > case for generation of links to this page. (I'd rather not do either)
> >
> > So, am I missing something, is there a way of doing this in
> onPassivate()
> > that anyone can think of?
> >
> > Does anyone else think that this is a feature worth having in
> Tapestry, so
> > that external URLs can have extra bits that internal (event) URLs
> don't
> > need?
> >
> > Thanks,
> >
> > Andy.
> >
> 
> 
> 
> --
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> Director of Open Source Technology at Formos


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


Re: Need help with tricky T5 URL / onPassivate problem

Posted by Howard Lewis Ship <hl...@gmail.com>.
How many query objects will there be?  You could store them in the database
and just encode a primary key into the URL.  Add a little bit to ensure
people can't use other's queries, and that they get janitored if not used
over some space of time, and you're in business.

On Sun, Jul 5, 2009 at 5:52 AM, Blower, Andy <An...@proquest.co.uk>wrote:

> I've been investigating and optimising performance of a search results page
> in our T5 app. The page needs to have a bookmarkable URL which will work
> without requiring any session information, so it can be used long after the
> session has expired. This necessitates putting the user's query in the URL
> which is then encoded and ends up as a very long string that becomes part of
> all results page URLs. If the session is present then it's ignored, and it's
> entirely optional - the page works fine with the query part of the URL
> removed, as long as the session is present and the query & results don't
> need re-generating.
>
> The downside to this is that every URL for this page has this large query
> object encoded into it, which is not a problem for render URLs since that
> will end up in the browsers location bar and potentially get bookmarked by
> the users, so we want this optional large query object to be present. On the
> other hand, event URLs also have this large query object as part of them,
> even though it is completely unnecessary (if the user clicks on a link when
> the session has timed out they will get a session ended page) and is never
> used. This has been manageable while there were not many event links on the
> page, but over time they have increased and now event links on the results
> page are weighing in at over a megabyte!
>
> What I want to do is only return the optional large query object when
> passivating for render URLs and not for event link URLs, but I can't figure
> out a way of doing this without hacking at T5 internals or making a special
> case for generation of links to this page. (I'd rather not do either)
>
> So, am I missing something, is there a way of doing this in onPassivate()
> that anyone can think of?
>
> Does anyone else think that this is a feature worth having in Tapestry, so
> that external URLs can have extra bits that internal (event) URLs don't
> need?
>
> Thanks,
>
> Andy.
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos