Radiator Caps are designed to ensure that the prescribed pressure on the cooling system is maintained at all times. The pressure is maintained during operation by allowing air to escape when pressure exceeds a preset amount.

As a result; radiator caps should be considered “the safety valve” of the cooling system.
So; radiator caps do several things;
• seals the system against the outside world (main seal function)
• keeps the system pressurized when needed, so as to raise the boiling point of the coolant
• allows excess pressure and coolant to be able to vent to the expansion reservoir (pressure seal function)
• allows coolant to return to the radiator when the engine cools down (return seal function)
Radiator caps have three seals, any of which may fail independently of the others;

1. Sealing the cap against the top of the filler neck is the job of the main seal. This seal keeps the whole system sealed and is considered the most important.
2. A leaking pressure seal will allow the coolant to boil at a lower temperature, and coolant will be able to travel freely to the expansion reservoir. This could result in localized hot-spots inside the engine. This may lead to premature cylinder head warping and may hasten head gasket failure. It will also cause the rad coolant level to be low, just like a failed head gasket.
3. A faulty return seal may prevent the coolant from returning to the radiator. This may lead to collapsed radiator hoses due to the excessive vacuum. This will prevent the coolant from circulating if the hoses don’t re-expand as the engine warms up.

A bad rad caps can cause similar symptoms to a failed head gasket
If you replace the rad cap and you still have bubbles in the coolant (or foam in the reservoir); then suspect the head gasket. So, If the engine starts to overheat at idle; or in heavy traffic; and the gauge goes down when you rev it; the coolant is probably low.

Moreover, a neglected cooling system can load up the cap with crud and corrosion; preventing proper coolant flow in and out through it. Peel the seals back with your fingernail to check for goop. Consequently, If you find any; a blast with a garden hose and probing with a toothpick should clear most of it out.
Conclusion

So, if you suspect the cap is failing, give it a thorough visual inspection. Start by looking for any damaged, cracked, hardened or worn out seals. Finally, if the seals look bad, replace the cap.