I did put on a cable lubricant when installing my r/d and remote lockout cables. I think it was Cablemagic, lubes the cable and helps prevent corrosion. My shifting is as smooth and accurate as the day I built the bike.
I've tried cable lubes in the past and have found that running them dry works best as long as you're using good quality cables and housing, and that doesn't necessarily mean expensive. Especially if you have multiple short sections of housing vs. a full run, it just seems like cable lube winds up attracting dirt and such. For the most part, they don't hurt, for sure, but I just haven't found them to be necessary or increase longevity.
To that point, I've tried a bunch of the high end fancy cable/housing sets - Nokon, Gore, etc - and don't find it to be worth the money. It's kinda like expensive spark plug wires for your car - if your old cables were really beat, the expensive new ones will make it seem like they're super awesome - when a new set of basic cables would have done the same thing. Plus, you don't feel so bad about regularly changing them which I've found over the years to be by far the best way to maintain shifting performance.
As for preventing corrosion, you should never be using anything but stainless cable so that shouldn't be an issue.
Haven't found any benefit to running drawn cables or coated cables, so I just run plain stainless Jagwire cables.
Run full housing wherever you can, and replace it when the shifting isn't perfect.