sitemap
sitemap copied to clipboard
Sitemap Limits
Can this automatically identify indexes over the 50,000 limit and produce multiple indexes when this occurs?
I suppose it could, the question would be how should it route to multiple sitemaps. If you have any good ideas on how to approach this let me know.
Here's how I went about implementing it in one of my controllers, using an optional integer page parameter in a route. I guess the package could somehow implement something similar internally?
public function posts($page = 0)
{
$tagsPerSitemap = 1000;
$posts = Post::skip($page * $tagsPerSitemap)
->take($tagsPerSitemap)
->get();
foreach ($posts as $post)
{
Sitemap::addTag(route('posts.show', $post->id), $post->created_at, 'daily', '0.8');
}
return Sitemap::renderSitemap();
}
I think you should also note that if your records have a lot of columns, to only select the ones you need to create the tag ... otherwise the process will quite without warning and you'll be presented with a blank screen.
Cool, I've added some details to the docs about using select()
and chunk()
to reduce the memory being used for a sitemap request - that should alleviate most blank screen issues.