Alright, I have an issue and I would love some advice. Here is the
I am developing a site which syncs with Google Calendar. You can
imagine, the whole bit: list of events, create events, delete events,
all from this from our rails site.
My problem is the request times are just too slow for the initial
listing of the events. Basically, the events are being listed on a
primary profile page and I can't allow the user to have to wait that
long to see their page.
I assume the answer to this is "offload to backgroundrb" or "load the
event list using ajax" or a combination of both. I just want to hear
opinions on how others would manage this.
Short Recap: User has a profile page which lists the next 5 upcoming
events on their calendar as part of the page. I need this page to load
reasonably fast but the request to GoogleCalendar takes very long.
Could someone explain the basic process for how to do this properly in
rails. I know I need to load the Google Calendar using ajax or at least
I guessed but what would be the "best practice" method to choose...
1) create an action in rails that parses google calendar lists into an
array of events and then use an ajax request to query that action, get
2) create a background worker that queries google calendar and then
create a rails action that starts up the background worker, gets the
events and returns them to the page invoked from an ajax request.
3) have a background worker that is continously querying google calendar
every 10 minutes for all the upcoming events for all the users and then
store them in a hash in the worker. then just query the worker and be
given the events immediately and print them to the screen
4) something inevitably smarter?
Please help. sorry this is long.