CDs and DVD degrade over time, I think this is primarily those with home recording CD / DVD-Rs. I am not sure what the difference is with Factory made CDs or DVDs like Music CD or DVD from Playstation 2 but those seems to be fine. I think I need to look this up that you have brought it to my attention.
But do HDD last longer if they are unplugged. And only start up when they are needed? In that case wouldn't an NAS putting HDD to sleep most of the time would prolong the life time of HDD?