Wash hands between sets. Be anal and OCD about it. Don't eat finger foods during gigs. No greasy stuff. Don't let junior with dirty/oily hands sit in. Wipe your hands off with a clean towel repeatedly during sets. Wipe strings down REALLY well after gigs. All that helps, but they will still get dull and die eventually.
I boiled my strings for twenty years. It works just fine. Brings them back to life a few times. I could get 3 to 4 boilings (boil for about 30 minutes) out of them before they could not be revived and had to be pronounced dead.
There is also a "quick fix" video on Youtube about "slapping the **** out of your strings." I find this works to an extent when you are at a gig and a string starts dying. You basically loosen the string so that it's very floppy and start pulling it out and snapping it back onto the frets. Do that for like two minutes over and over. Surprisingly, it often does brighten them up. Not always, though. Plus, I don't like being so violent with the strings or the frets/nut/bass in general. But, it often works in an emergency.
BEST SOLUTION (in addition to keeping them clean in the first place):
Within the past few years, I have been soaking ailing, sickly strings in denatured alcohol for 1 to 2 days. It really does work! I generally have two sets per bass that I alternate--play on one set while the other is soaking. And the cool thing is that there really is no limit on how many times a set of strings can be resurrected, other than when the windings get badly deformed/dented or come loose. I have seriously soaked sets of strings 15 or 20 times before they are structurally unsound. After soaking them, they are VERY, VERY close to sounding new. Over and over. Saves gobs of money.
I have found that it works best on stainless steel strings, but it does work on nickels as well. I have not tried it with flats, since I seldom use flats. I use D'Addario Pro Steels, which I have found stays bright way longer than any other strings I've tried before dying. But now with the denatured alcohol trick... well, my strings are nearly immortal.
