Optimize short URL generation and redirect.