There are a couple of techniques that can be used for getting more string life from your bass strings. These all involve cleaning the strings in some manner.
This process is really only recommended for the following types of strings: round wound, ground wound, and half wound/half ground wound. It does not really get more string life for flat wound or nylon wound strings.
The most simple method is to simply place your strings in a pan of water, and then set the pan of water with the string on the stovetop and boil them for about 10-15 minutes. Then let the water cool down, and pour off the water into the sink. Then let the strings air dry.
This process removes most of the oils and tiny pieces of flesh from the string windings, which is why your strings start to sound dead or flat sounding. This process of cleaning the strings by boiling them can realistically be done only about 2 or 3 times. (It is sort of like charging non-rechargeable batteries.
Though they are not designed to be recharged, they can be a couple of times). Getting more life string life for your bass is similar.
Another option is to add something to the water when boiling the strings in water on the stove for about 10-15 minutes. A strong dishwashing soap (only a few drops) added to the water will aid in the cleaning of the strings.
Another option is to add a 1/8 -1/4 cup of vinegar to the water. This makes a mild acid that helps clean the string windings. I would not recommend both of these methods at the same time.
Be careful not to cook the strings by letting all of the water evaporate during this process. And be careful not to burn yourself when removing the strings from the pan.
Another method is to take a small toothbrush and detergent water and brush the strings perpendicular to the core. You will need to rotate the strings as you do this. This is quite a tedious project. I have done all of the above methods, and they do work.
Another good idea is to boil the strings (in hot water on the stove for about 10-15 minutes) before putting them on the bass for the first time. Many manufacturers still have machining oils on the strings, either in a heavy or light dose. This will remove these oils and result in a very uniform-sounding set of strings.
You also might want to experiment with using a degreaser product to clean the strings.
The life span of your strings depends on the manufacturer, how often you play your bass, and how many oils your hands produce.
I have one friend, whose hands produce an acid type of oil, and his strings actually rust as a result of his hand oils. Speaking of oils, I have actually seen bass players spray a product called “Finger Ease” on the strings while playing a gig. Needless to say, there were no mids or highs in his sound.