[Neos] RFC: Get rid of "lastVisitedUri"

Aske Ertmann aske at moc.net
Mon Nov 25 20:26:08 CET 2013

Hi Bastian

> I did some rough benchmarks and the performance hit seems to be very minor indeed.
> It seems this boils down to balancing the advantage of editors to be redirected to the last visited page and a (very small) performance hit on every request in live workspace.
Good to know.

> I can't judge whether this very drawback is negligible or not, but I agree to the measures (putting it in an external file…).
I see your new patch set and since it now relies on the node identifier, it's not possible to put in a file, which I guess is why you kept it that way.

> But we should really avoid creating or even storing URLs on the client side. In this case we "reconstruct" the URL to redirect by hard-coding
> "@<workspace>.html" to the lastVisitedUri that was stored in the session.
> This breaks support for installations without RewriteEngine support. It also breaks custom routes and it leads to a 404 if the page has been moved in the meantime.
This is somewhat true. The URL stored is the one pages actually being accessed on, which would take RewriteEngine into account. However it wouldn't take a different domain into account, didn't think we actually stored the domain. However regarding the 404 it actually checked if the path could be found before redirecting, so it wouldn't redirect to a 404 unless you changed domain apparently.

> I'd suggest to store the identifier of the current document node instead and redirect to that upon login (if it is accessible).
I guess we can do it like that, of course has the drawback of being unable to put into a file that can be cached by the client.

> Also I don't see a reason why we need to store it in a session at all. We should instead add a hidden field to the logout form with the identifier of the last edited document node.
There's actually a good reason for this, because we can't always add the session value to a hidden field when accessing the backend. If you're already logged in you are redirected directly without the login form. So adding it after having logged out wouldn't solve the problem.

>> Being able to add /neos is then something that the editor has to remember and do
>> which I think most will forget however this is happens automatically
> I'm not sure whether I got this one right.
You suggested that the editor could always add /neos to any url .. homepage.html/neos which is something that the editor then has to remember instead of the redirect happening automatically without the editor having to remember or do something special.

More information about the Neos mailing list