0

I am building a real time notification system for my site. I am using Pusher for the notifications, etc. I am able to push the notifications fine, but now I am running into the issue of how to save them (for example, when FB has several saved up for you to check at a later time.

My thoughts were to take the notification, display it in real time, then save it as either a session variable or cookie. However, this could get out of hand if a lot of notifications are being pushed. My next option would be to push the notifications into a temporary table, and when a user clicks on the archived alerts, I could display them there. I was just looking for the cleanest, and easiest way to do this. Any help is appreciated.

1
  • Did I answer your question or do you need some extra information? Commented Jul 27, 2013 at 10:02

1 Answer 1

1

I suggest you that you do something similar like FB did (users are already used to it).

I recommend database table "notification" with "clicked" property. Try to group similar notifications and display at most 10 of them with "View all" option.

Puting this inside session or even cookie is very bad idea (all data will be lost after few hours and you will have a lot of problems with maintaining everything. Just few hints: what if user logs out, what is max size of cookie etc ...)

If you want to store anything localy use localStorege (html5) but honestly - I think there is no need to do this ...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.