Every cPanel includes Optimize Website function. It uses Apache's mod_deflate to compress content before sending it to the visitor's browser.
Gzip is the most popular and effective compression method today. If gzip compression is enabled for website content, it generally reduces the response size by about 70%. To gzip your website components, log in to your cPanel > go to Software and Services section > Optimize website menu.
Here you need to select Compress all content and click on Update Settings.
For cPanel paper_lantern theme:
For cPanel x3 theme:
Select "Compress all content" and click on Update Settings.