app/controllers/sitemap_controller.rb
# Important note: 4,000 is a good average_chunk because it's large enough to fit into the 4096 leaves option (3
# character placeholders) scheme, and can be rendered by Rails performantly. Larger numbers can tax Rails.
Important note: 4,000 is a good average_chunk because it's large enough to fit into the 4096 leaves option (3
character placeholders) scheme, and can be rendered by Rails performantly. Larger numbers can tax Rails.
Important note : 4 000 is a good average_chunk because it ' s large enough to fit into the 4096 leaves option ( 3 character placeholders ) scheme and can be rendered by Rails performantly . Larger numbers can tax Rails .
def access_list
      approximate_chunk_size = [4000, max_documents].min 
      access = (Math.log(max_documents / approximate_chunk_size) / Math.log(16)).ceil
      (0...(16**access))
        .to_a
        .map { |v| v.to_s(16).rjust(access, '0') }
    end
def access_list approximate_chunk_size = [ 4000 , max_documents ] . min access = ( Math . log ( max_documents / approximate_chunk_size ) / Math . log ( 16 ) ) . ceil ( 0 ... ( 16 ** access ) ) . to_a . map { | v | v . to_s ( 16 ) . rjust ( access , '0' ) } end
Important note: 4,000 is a good average_chunk because it's large enough to fit into the 4096 leaves option (3
character placeholders) scheme, and can be rendered by Rails performantly.
Important note : 4 000 is a good average_chunk because it ' s large enough to fit into the 4096 leaves option ( 3 character placeholders ) scheme and can be rendered by Rails performantly .
# Sufficiently less than 50,000 max per sitemap