-
Notifications
You must be signed in to change notification settings - Fork 306
SitemapGenerator Usage
rab edited this page Sep 13, 2010
·
7 revisions
Please add your name, site and how many links in your Sitemap, and extra information (e.g. code).
Adam Salter, www.answermyoffice.com, 72,956 links, 2m03s
Zipcode.find(:all, :include => :city).each do |z|
sitemap.add zipcode_path(:state => z.city.state, :city => z.city, :zipcode => z)
end
Rob Biedenharn, stylepath.com, Sitemap stats: 4,684,358 links, 6h21m31s
Category.find_in_order.each do |category|
sitemap.add category_page_path(category), :changefreq => 'daily', :priority => 0.6
Product.interesting_from_category(category.id, 0, nil, true).each do |product|
sitemap.add details_id_path(product), :changefreq => 'weekly', :priority => 0.5
end
end
And running against a Rails 1.2.2 project. Only a few changes needed:
- Need to provide a String#present? (which was easy since I already had String#nonblank?)
- Cope with the change from
app/controllers/application.rb
toapp/controllers/application_controller.rb
by adding:-
require 'app/controllers/application'
tolib/sitemap_generator/helper.rb
-
mattmueller, 1.9 million urls
It took about 2 hours to generate on a very powerful production server without niceing it. If you decide to nice it (we tried at 15) for that sort of load it would take > 8 hours