Home > pagination > Memory errors when using Pagination

Memory errors when using Pagination

June 12Hits:0

I'm running into memory problems when using pagination both with a channel:entries loop even though I'm displaying only 9 at a time.

My testing is showing that it's definitely the introduction of pagination links that is causing the problem. My assumption is that the system is retrieving everything in order to count the number of entries and create the links. Even though there are only 430 entries in total.

I've even tried using a custom query using exp:query but with no real improvement. The only way to prevent the error is to use a LIMIT clause in the SQL - but then the pagination count isn't going to work.

The server is configured to have a 128M memory limit for PHP. I'm enquiring to see if this can be increased (the same site running on another server with a 256M limit chugs along happily). But I'm worried that this is, at best, a stop-gap solution. It would be far better to work out how to reduce the load when generating the pagination.

Is anyone aware of an add on which handles pagination more efficiently than the built in system?

Failing that, the only solution I can see is to use the custom query with a LIMIT clause to get the entry information and then build a separate query to generate pagination links (and create offsets to use in the products query). Which seems mad.

Any help appreciated!

Related Articles

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.466 s.