We investigate the relationship between the compactness of embeddings of Sobolev spaces built upon rearrangement-invariant spaces into rearrangement-invariant spaces endowed with d-Ahlfors measures under certain restriction on the speed of their decay on balls.