I’m building a site for a community area which will act like a community board, showing what local events are coming up next today and into the future. The homepage will take that list of events and show titles, images, dates, etc so visitors can see what’s going on today (but not what’s already happened today). Both the home page and the calendar pages will show these upcoming events, refreshed every half-hour or so.
Also, each event could have several dates/times as in a local theatre which shows a play several times a day over the span of a few weeks. All of these event dates are stored in a structure field inside an event.
If we have 100+ events, and I want to know what’s next every half hour or so, would it be more efficient to query for the list of events and times using a content representation, or caching this list in a file cache that we update?
I don’t see how a content representation would be useful here. But it would certainly make sense to cache the list. Considering that you are using the same list in two locations, it might however make sense to store the list in a custom cache and refresh every 30 minutes, and query this cache in both of your templates.
Thank you @bnomei! That looks like a great plugin. In this case though, I think I’ll have to break the cache every 30min because I need to show what’s coming next in the daily calendar, as time passes. So if it’s 3pm when a user visits the site, I only want to show events happening at 3pm that day or later into the future. Then at 4pm I only want to show events happening at 4 or later.