I've been asked by a client to implement page 'locked' functionality on certain pages.
THE PROBLEM A user is updating a certain page and then another user also comes onto the edit page and makes various updates which overrides the updates the initial user was making.
My current thinking is to implement a middleware which adds the current user as well the page they're viewing into the cache for x number of minutes. When another user tried to view that page, an overlay will be displayed to say that the page is locked as x user is currently making changes.
What would be the best way to implement this?