Wednesday, November 25, 2009

Re: Pagination on cached data?

On 25 nov, 15:17, leberle <delf.ton...@gmx.de> wrote:
> > ps ->paginate($somethingMaybeHuge); is IMO a really bad idea/negating
> > the point of pagination
>
> Hm, i'm not sure if i get you right....you say that it may be a bad
> idea just because the data passed maybe very large? Dont you have the
> same problem if you call paginate with bad settings, e.g. limit
> 123456789?

If you've ever done that, it's called shooting your self in the foot/
not sanitizing user parameters/screwing up :).

> IMHO it's in the responsibility of the developer to take care about
> the size of the passed data...well, whatever, it would be nice to have
> the pagination available for data that doesn't come from a model.

Perhaps I misunderstood your question. I understood you to mean:

$data = cache('some.key');
$abitofdata = $this->paginateorequivalent($data);

I hope you see the problem in doing that. You can't control the size
of $data in such a case, as you don't know how big it is until you've
recieved it - which may never happen if you run out of memory in the
process.

> Btw: i decided to do the caching in the datasource, so paginate works
> fine as there is no difference in the upper MVC layers.

Cool idea, same principle.

AD

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: