The rear derailleur does all the shifting work and dangles down close to the ground getting caught on twigs and picking up debris. It’s also the part that your bike lands on first if you crash on your right-hand side or drop the bike. If you have time to think when you’re crashing, drop the bike on the left – it’s far cheaper!
Shimano Shadow derailleur
If your shifting is still sluggish after you’ve adjusted the endstop screws and the cable tension, then it’s time to treat your rear derailleur to a little clean and re-lubrication. The separate sections of the derailleur need to be able to move freely, so that your shifting is crisp. The pivots that connect the parts work best if they’re not jammed up with dirt and have a little oil to lubricate them.
The first step is to clean your rear derailleur. This is easiest with the back wheel removed, so you can get to everything. Wipe down the outside, then use a little brush to get mud and dirt out from inside the mechanism. You don’t need to carry that muck around with you. You need to move the derailleur through its range to get inside it. With your left hand, hook a finger behind the back of the derailleur and push the front part of the derailleur body away from you. Once you’ve got the dirt out from the inside, clean off the jockey wheels. They collect oil and mud and grind them together into an excellent chain-eating paste. Scrape this off with the end of a screwdriver. Next, check how worn the derailleur is. The teeth on the jockey wheels should have flat tops, not points. Take hold of the bottom of the derailleur and wiggle it towards you. It should flex rather than knock or flap about freely. When these things happen, it’s time for a new derailleur.
Next, oil the pivot points. There are at least four on the derailleur body. Drop a bit of oil into the jockey wheel bearings, the knuckle where the derailleur rotates on the frame, and the point where the derailleur body meets the arm to which the jockey wheels are attached. Once you’ve oiled all these parts, move them to work the oil into the gaps. Push the derailleur away, as if it was changing gear, then allow it to spring back several times. Wipe off excess oil. Refit the back wheel. If you feel like giving your bike a Christmas present, remove the rear derailleur and give it a thorough scrub. Undo the bolts that hold on the jockey wheels, remove them and take the back of the cage off to clean properly between the cage and the jockey wheels. Push the bearings out of the middle of the jockey wheels, clean and oil them, then refit using Loctite 243 on the bolt threads. Don’t be tempted to swap the top and bottom jockey wheels – they’re usually a different shape because they do a different job. The top guide jockey wheel pushes the chain sideways, from one sprocket to the next. The bottom tension jockey wheel pulls the chain backward, taking up slack. In addition, guide jockeys like the one in the picture, from a Shimano XT derailleur, have a rotation direction. Set this up so that pedalling forward makes the jockey wheel roll in the direction of the arrows. This can be achieved by bolting the jockey wheel into the derailleur so that the writing faces outward. Use a small brush to scrub dirt from inside the body of the derailleur and oil the pivot points. Refit the derailleur, again using instructions for fitting a new derailleur.
Source : BIKE MAINTENANCE TIPS, TRICKS & TECHNIQUES
See also bike maintenance tips, tricks and techniques “Fitting a new rear derailleur”