Blazer Air Conditioning

We have a 1996 Chevy Blazer with a V-6 motor. A coule years ago we had the air conditioning unit replaced and upgraded as well as replacing the serpentine belt. Since that time, it has stopped working more often than it does work. While cruising on the highway, I can make it work by flooring the gas pedal as if to pass a car for a second or two, then letting off back to cruising speed. The ac will work well then. If I let off the gas, it will stop working again. In town driving causes it to work on occasion, but most often not. Thanks for your time.