Java is constantly hammering the database with requests with "Is there a new personal message or not." It is easier to cache the user and enter there in the message field - the number of messages (new) and after reading - delete this number from the user's cache, say -1 from what is there, to 0 messages. And faster and more economical.
Well, the conclusion should be made from the cache - if there is a new message for the user, then - show a pop-up window (although in our script it is done under the menu with a red rectangle - You have *** new messages), if not, then do not display anything.
|