Possible bug in ActiveRecord::Base#to_xml and caching

So I’ve got this weird problem showing up in the production environment to where when I grab xml from resources, the xml results get cached, but not used. This means that every subsequent request appends the results to the cache.

This happens when config.cache_class = true; happens in both WEBrick and my Apache2 fastcgi deploy.

And an example run:

C:\Development\AdminPortal\proto>wget http://localhost:3000/phone_carriers.xml … 09:21:34 (869.14 KB/s) - `phone_carriers.xml’ saved [890/890]

C:\Development\AdminPortal\proto>wget http://localhost:3000/phone_carriers.xml … 09:21:35 (1.70 MB/s) - `phone_carriers.xml.1’ saved [1780/1780]

C:\Development\AdminPortal\proto>wget http://localhost:3000/phone_carriers.xml … 09:21:36 (2.55 MB/s) - `phone_carriers.xml.2’ saved [2670/2670]

As you can see, the exact same request returns increasingly larger results. There are only 5 records being returned here, but the 2nd request gives me the results twice, and the third request gives me the results a third time:

<?xml version="1.0" encoding="UTF-8"?> ... <?xml version="1.0" encoding="UTF-8"?>

<?xml version="1.0" encoding="UTF-8"?> ...

I’m currently looking into the problem, but was wondering if anyone here had run into this or has an idea on where to look. I can’t find anything via Google or on the Trac.

My environment:

Ruby version 1.8.6 (i386-mswin32) RubyGems version 0.9.2 Rails version 1.2.0 Active Record version 1.14.4 Action Pack version 1.12.5 Action Web Service version 1.1.6 Action Mailer version 1.2.5 Active Support version 1.3.1 Edge Rails revision 6494 Application root C:/Development/AdminPortal Environment development

Database adapter mysql

Thanks.

Jason