Question

i have a news website that update once-twice in a day, and i want to develop something that will let my users know when there is new content in my website, it will popup them a notification, only one notification per each content its sound easy the problem that i face is how i make it efficient in crossrider without every page reload make a call to the database?

how i doing it right now(not efficient) i have in my server php file that post the id's of the last news, the crossrider read that file and for each id it call the crossrider db and check if that id exists if yes than the user has already recive a notification about that content and should not be notificated, and if its not exists than notify the user. so as you can see every reload of a page the extension will make a call to my server and to the db server. any better way to build this? thank you

Was it helpful?

Solution

If I understand your query correctly, you can gain an immediate efficiency by calling the Crossrider db using appAPI.db.getList to obtain an array of all the database items (instead of calling the database for each id), and then process the ids against them.

I'm happy to look into other ways of improving the efficiency of your algorithm if you provide the extension id.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top