-
Notifications
You must be signed in to change notification settings - Fork 277
SitemapGenerator Usage
Please add your name, site and how many links in your Sitemap, and, if you feel like it, a small snippet of cool code, showing how SitemapGenerator made your life easier.
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
openc, 104+million urls for OpenCorporates
Takes several days to generate. Runs weekly on worker server (also processes Resque jobs), and then SCP’d to shared folder on app server, which is symlinked from production.
Eric Hochberger, 300k+ urls for The Hollywood Gossip
Since my main sitemap takes too long for Google to process, I take advantage of sitemap_generator’s multiple config option. I generate smaller sitemaps for rapidly changing content such as news.