According to Shannon's source coding theorem[1]}, no algorithm can compress data shorter than its entropy.
On the other hand, if the distribution of data is known in advance, an entropy coder can be applied so that the code length would be very close to its entropy, thus obtaining the optimal compression ratio.
