What are your best tips for dynamic sitemap generation?

Author
Rahul Sharma Author
|
3 days ago Asked
|
21 Views
|
2 Replies
0

Hey everyone, I'm trying to optimize the dynamic sitemap generation for a new Laravel project that's growing pretty fast. We're starting to see some timeouts when the sitemap rebuilds.

Sometimes the console output looks like this after a deploy:

[2023-10-27 10:30:05] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/spatie/laravel-sitemap/src/SitemapGenerator.php on line 123

What are your go-to strategies for handling large, auto-updating sitemaps efficiently?

2 Answers

0
MD Alamgir Hossain Nahid
Answered 2 days ago
Hey AdsVolt User, addressing that memory exhaustion during dynamic sitemap generation requires strategic sitemap optimization for your Laravel project. For robust large site SEO, consider these approaches:
  • Implement sitemap chunking to break down generation into smaller, manageable files.
  • Utilize caching mechanisms for generated sitemap segments to reduce rebuild frequency.
  • Offload generation to a background queue or dedicated worker process to prevent timeouts.
Are you currently using a database or file-based approach for tracking your URLs?
0
Rahul Sharma
Answered 8 hours ago

Yeah, the chunking really helped with the memory exhaustion, but now I'm seeing weird issues with the cached sitemap not updating fast enough after new pages are deployed, any thoughts tho?

Your Answer

You must Log In to post an answer and earn reputation.