MagSafe Power Cable Going Yellow
Solution 1:
Depending on how old the charger is, it is possible the agent causing the discoloration is leaching through from what the casing covers instead of being caused by an external source. In this case, bleaching and cleaning will affect only the surface of the cable.
I used to have several cables like this, on old barrel-shaped (non-MagSafe) chargers, but when the laptops were recycled, so were the chargers, so I don't have anything to dissect to prove my assertion.
The power charger can also get quite hot when charging, and if the charging cable is partially or wholly wound on the charger body's cable-storage fingers, they may become very hot as well, causing some of the discoloration you see. I always fully unwind the connection cable before charging.
Solution 2:
Typically when I clean my power adapter, I use a paper towel or cloth which is damp with rubbing alcohol. I have found this is be very effective for removing dirt. Rubbing Alcohol can leave a residue so you may also consider using a paper towel or cloth which is damp with water to rinse afterward.
Solution 3:
Cleaning the cable with a baking soda solution is likely to help. Baking soda will act as a mild abrasive. Alternatively, some web sites suggest using a bleach mix.
Do not soak the cable and do not get either end of the cable wet. Please be careful!
Solution 4:
I got it replaced at the Apple Store. The "genius" explained that the old ones (pre-2011?) were softer and contained halogen from memory, whereas the new ones were more rigid and environmentally friendly. This probably means they don't change colour as easily and break.