Enabling compression in Apache can significantly reduce the size of data transferred between the server and clients, leading to faster page load times. The most common method for achieving compression in Apache is by using the mod_deflate
module. Hereโs how you can enable compression with examples:
Step 1 go to below path
/opt/lampp/etc
And open below path
httpd.conf
And do uncomment as per below
LoadModule deflate_module modules/mod_deflate.so
Next go to virtual host file and add below data
LoadModule deflate_module modules/mod_deflate.so
<VirtualHost *:80>
ServerName example.com
LoadModule deflate_module modules/mod_deflate.so
AddOutputFilterByType DEFLATE text/html text/css application/javascript
<Directory "/opt/lampp/htdocs/wizbrand/wz-siteadmin-ms/public">
Options Indexes FollowSymLinks
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
Next restart your apache server using below command
sudo /opt/lampp/lampp restart
Thanks for learning ๐๐