title: Rails sitemap_generator & Heroku How to Handle Large Sitemaps?
body: <p>I am using the <a href="https://github.com/kjvarga/sitemap_generator" rel="nofollow noreferrer">sitemap_generator</a> to create my sitemap for a Rails 6 app, which is hosted on Heroku.</p>
  <p>Since Heroku is a read-only file system, I am using an adapter to upload the sitemap to s3. Standard gem config so far.</p>
  <p>Here is the problem:</p>
  <ul>
  <li><p>Our app has 200,000 products</p>
  </li>
  <li><p>One site map can only contain 50,000 URLs, as per <a href="https://www.sitemaps.org/faq.html#:%7E:text=Q%3A%20How%20big%20can%20my,a%20maximum%20of%2050%2C000%20URLs." rel="nofollow noreferrer">rules</a></p>
  </li>
  <li><p>The sitemap_generator docs state when using an adapter <code>SitemapGenerator will automatically turn off include_index in this case because the sitemaps_host does not match the default_host. The link to the sitemap index file that would otherwise be included would point to a different host than the rest of the links in the sitemap, something that the sitemap rules forbid.</code></p>
  </li>
  <li><p>sitemap_generator is overriding the above statement and generating an index, which includes URLs to the other sitemap files (s3 URLs)</p>
  </li>
  <li><p>Google does not like this</p>
  </li>
  </ul>
  <p>Has anyone been in this situation before? Any tips would be greatly appreciated.</p>