How to implement caching for multi-user calendar with events?
I'm working with a multi-user calendar where each user has associated events. There is a week view and a day view. The user can choose (from a list) which users calendars they want to view at any given time.
So I may choose to view the schedules of users A, B and D, go to the next week, select user C and deselect user A. Etc.
How might I implement caching for this so I don't have to send a new request for each user for each day/week view.
Currently I'm making one request with the selected users each time the calendar is navigated. I'm thinking maybe I could make a new request for each user for each day/week and cache those somehow so that no matter which set of users is selected开发者_如何学Python, it can build the users array from individual caches?
I'm using Rails 3 and JQuery.
Any ideas? Thanks.
As your views do not seem to be easily broken down into cachable fragments, you could build the entire view with jquery und just pull in the different calendars via AJAX. Have a look at the jquery template plugin which is a huge help. You could then cache the json responses which actually deliver the individual calendars.
精彩评论