I'm trying to create an XML sitemap using CakePHP, from a table which has more than 50,000 records at the moment, each record equivalent to a URI in the sitemap. Now the problem I'm facing is CakePHP is running me out of memory while generating it, for two reasons:
- A
find('all')
is building a huge associative array of the entire set of 50,000 URIs. - Since I don't want to output HTML from the controller itself, I'm transferring the associative array containing URI, priority, change frequency etc., to the view with a
$this->set()
call -- which again is huge, containing 50,000 indices.
Is it possible at all, to do this while following MVC and CakePHP guidelines?