Refrigerators on Shabbos
A refrigerator produces cool air by cycling gas through tubes located behind the refrigerator. When the gas compresses and expands through the tubes, it produces cool air which is pumped throughout the inside of the refrigerator. A pump called the compressor, cycles the gas through this system and if left running all the time, would freeze anything inside.
To keep temperatures in the refrigerator regulated, manufacturers added a mechanical thermostat which acted as bridge to the compressor’s electrical circuit. When temperatures cooled, the thermostat would contract, severing the electrical circuit and shutting the compressor off. When temperatures got warm again, the thermostat would expand, completing the electrical circuit and activating the compressor once again.
Old Refrigerators and Halacha:
If the door to the refrigerator is opened letting in warm air, it can cause the thermostat to contract, completing the electrical circuit and turning on the compressor again.
In refrigerators with a compressor only, there were three opinions in the poskim if it was allowed to be opened on Shabbos:
- The refrigerator is not allowed to be opened on Shabbos at all. 
- The refrigerator was allowed to be opened only while the compressor was running so that letting the warm air in would not directly activate it.
- The refrigerator could be opened even when the compressor was not running.
See the discussion of Today's refrigerators on the discussion page.
- Rav Nissim Karelitz (Chut Shani Shabbat v. 1, p. 199) quotes the Chazon Ish as ruling that it is forbidden to open a refrigerator even if the compressor is already running. He explains that since there is a concern of a potential Biblical prohibition if it isn't already running. He doesn't consider this to be a dvar sheino mitchaven since it is theoretically possible to ascertain if the compressor will turn on upon opening the refrigerator (see Taz 316:3 regarding the definition of a pesik reisha). Furthermore, he says that it is forbidden to open the refrigerator when the compressor is running since it is likely to come to a prohibition if a person would open it at the wrong time.
- Rav Yosef Henkin (Edut L'Yisrael p. 122) writes that one should be strict to only open the refrigerator when the compressor is already running even though he feels that the primary halacha is that there's melacha involved with causing the compressor to begin (see Edut L'Yisrael pp. 151-4). In explaining why it should be permitted to open the refrigerator when the compressor isn't running he writes that since the melacha doesn't occur immediately (grama) and is physically disconnected from where he acted it isn't considered as though he did any melacha. He considers this better than a pesik reisha and considers it not to be a melacha at all just like closing the door of a house in which a candle is burning and will burn longer once the door is closed. Rav Moshe Feinstein (Igrot Moshe OC 2:68) writes that it is good to be strict only to open the refrigerator when the compressor is running like Rav Henkin. See, however, Igrot Moshe (4:74 Bishul no. 28) and "Opening Refrigerators on Shabbat" by Rabbi Jachter.
- Minchat Shlomo 1:10