a2enmod deflate a2enmod headers nano /etc/apache2/conf-available/gzip.conf # Сжимать только текстовые типы AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css AddOutputFilterByType DEFLATE application/javascript application/x-javascript AddOutputFilterByType DEFLATE application/json application/xml AddOutputFilterByType DEFLATE application/xml+rss application/rss+xml AddOutputFilterByType DEFLATE image/svg+xml # Не сжимать уже сжатое SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|webp|ico|zip|gz|rar|7z|mp4|mp3|woff2?)$ no-gzip dont-vary # Не сжимать для древних браузеров BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Заголовок Vary для прокси Header append Vary Accept-Encoding apache2ctl configtest service apache2 restart curl -I -H "Accept-Encoding: gzip" http://localhost/pw_web_sait/lk/Frontend/public/css/style.css