Thanks for the reply.

The number of channels is variable but always more than a 100.

I would prefer not to cache in the client as I would still have to
serve up an entire days worth of the schedule for every user. I
definitely have to cache on the server. I think my best option, if I
cant get Cake to do it, is to use Memcache.

On Jul 16, 9:21 am, cricket <zijn.digi...@gmail.com> wrote:
> On Fri, Jul 16, 2010 at 8:44 AM, RhythmicDevil <rhythmicde...@gmail.com> 
> wrote:
> > Hello,
> > I have a view that shows a television schedule, similar to DirectTVs
> > (http://www.directv.com/DTVAPP/epg/theGuide.jsp). It is a list of
> > channels and programs in a 4 hour slice broken into 1/2 hour columns.
> > When the schedule first loads the start time is is the most recent 1/2
> > hour mark. Meaning that if its 7.03am the window will start at 7am. If
> > the time is 7.47am the window will start at 7.30. You are able to page
> > left and right in 1/2 hour chunks.
>
> > I am trying to improve performance of the view, as you can imagine its
> > a ton of data to compile and the HTML is fairly complex. My aim is
> > cache the most current schedule chunk. So assume the time is currently
> > 7.03am. The application gets it's first request for the schedule. The
> > controller fetches the schedule from the model starting at 7.00am and
> > then caches it. All subsequent requests for that particular start time
> > (7am) for all users will use the cached version until 7.30am at which
> > point the cache is cleared and process starts again.
>
> > I have implemented Cake's view caching and set the cache action as
> > follows:
>
> > $this->cacheAction = array('getTvSchedule/' => 1800);
>
> > This causes an obvious problem. If the first request for a schedule
> > comes after a 1/2 hour mark (7am, 7.30am, 8am etc) the cache will
> > refreshed a half hour after that time and not at the next half hour
> > mark. I can do some math to figure out the remaining time and use that
> > to set the cache timeout.
>
> > My big problem comes when paging right and left in time. The cache
> > manager does not recognize that a different request has been made and
> > it serves the current cached version. How do I get the cache manager
> > to see the difference?
>
> How many channels are you working with? My first thought is to cache
> the entire day's schedule and use javascript to display only a certain
> portion. Off the top of my head, I'm not quite sure how I'd do that
> but I'll bet there's a really elegant way to do that with, say,
> jquery. I'm thinking that you'd give the table colgroups [1] IDs based
> on the time (note that IDs cannot begin with a digit so prepend some
> string to each). Then have your JS parse out the hash portion of the
> URL to figure out from where to display from.
>
> So, your JS would, on page load, hide the entire table, then parse the
> location.hash value (if not exists, start from the beginning of the
> table), and then slide the table colgroups to the left (obviously, use
> CSS overflow to hide what is "off" the screen) until the desired time
> colgroup is at the left side. Then your paging links would simply call
> a JS function to slide the schedule left or right. No reloading the
> page.
>
> Does that make sense?
>
> BTW, with Cake, you can create a link with a hash value by using the
> '#' option in $html->link().
>
> [1]http://www.w3.org/TR/2010/WD-html-markup-20100624/colgroup.html

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to