From: Gustavo S. <gus...@gm...> - 2010-03-23 15:21:45
|
Hi all, I have a question, about how we can resolve that: Imagine this case: User A have access to a TODO #1 User B have access to a TODO #1 1- User A is online, see the TODO #1 (the access is cached) 2- User B is online, see the TODO #1 (the access is cached) 3- Now the admin for example, remove the User A from the TODO #1, and keep only the access to the User B. Point a) - The User A that is online, since he is not anymore in the item TODO #1, he don't receive any message about the change. Point b) - If the User A was IN the TODO #1, and try to change something, he will get a message "The item don't exist" (for him, don't exists anymore) Point c) - The User B, since is still in the item, get a front message that the TODO was changed by the admin, but when he want to see the changes, the access still say "User A and User B", since the access is cached in the server. That is more or less not so important, since is an strange case, but what about the same on a project? If the User A is removed from a project, then he will have some errors when try to access to it (an Exception since the "node" don't exists). If the User A is ADDED to one project, the user will receive a front message, but he DON'T will see the new project, since the access for all the projects is already cached from the server for him. The solution is "logout, and login again". These cases, are not so commons, but can happen and we should offer some solutions for that. In resume, the problem is, if you keep the data PER USER in the SESSION, for improve the speed, then when other user change something, the current user have the old data cached in the server side. Solutions: 1- An extra request to the server that say "remove all the cache". - That can be called when a front message appear, but will work only if the front page is activated. 2- Don't cache the access of several users. - The speedy will decrees. 3- Keep the cache in the server as a file instead of the SESSION (like the project tree or the language), so any user can access to it, and delete it for be re-calculated. - Access to a file have always less performance that access to the memory. Suggestions are welcome :D Greetings, Gustavo Solt |