Posted in ColdFusion | Posted on 09-13-2005 | 3,844 views
As folks know, I like to share mistakes because, I hope (pray) that I'm not the only one who makes them. I also figure if it "saves" someone from repeating it, then I've helped someone else.
So - if you subscribe to my RSS feed, this morning you may have noticed that I had a few new entires. Over 700. What did I do wrong?
I was reading Pete Freitag's entry this morning about how Google now accepts other formats for sitemaps, including RSS 2. So I whipped up a quick modification to the RSS system for BlogCFC. By default, the generateRSS method puts a limit on how many entries are returned. That limit is 15. For the site map, however, I needed to generate a list of all the entries.
So, I simply commented out the upper limit, created a new RSS file. I felt like I had covered all my bases. The generation was slow, but I cached the results so it should load up faster when refreshed. I tested it - and it worked.
All of a sudden someone on IRC let me know that my RSS feed was showing a lot of new entries. Turns out - my code that restricted the total number of RSS entries, also happened to set a default. Without a default, my main RSS feed was now showing all of the entries. This had a lovely effect on my CPU usage as well.
So, for those on my RSS feed, sorry!


It might make more sense to just include a file in your blog CFC dist that generates a google sitemap using their schema. That way you can also add category pages, and other pages that might not show up in your RSS feed.
Just a thought.
It sounds like your generating the sitemap statically after you post each entry then right? The way I have done it, is just create a dynamic sitemap, Google will only hit it once a day.
Ray: I doubt you caused problems for much of anyone. Now, if you had fiddled with your permalinks *and* dumped 700 entries into the feed... *that* might have been a touch annoying. :D
[Add Comment] [Subscribe to Comments]