Reputation: 111
I am working on a project using google calendar API. I managed to sync the events from my site to gcal api, when i try to loop the events from gcal and see which ones changed and make the changes on my site, page loads slow.
My question, is there an easy way to update the event from Google Calendar back to my site without loading the page slow?
I was thinking about using cronjobs, but i can't use that.
Upvotes: 0
Views: 339
Reputation: 372
You could trigger this event from client side using Javascript after page was loaded, but keep in mind to add some ddos protection.
The other way is to have a node js server running on the backend in parallel which would have a scheduled task to do this, but that is overengineering replacement of cronjob solution.
Also this could help you - just create a channel to watch for event changes:
https://developers.google.com/calendar/v3/push#receiving-notifications
Upvotes: 1