Make web faster - a safe htaccess way

<IfModule mod_deflate.c># Insert filters / compress text, html, javascript, css, xml:AddOutputFilterByType DEFLATE text/plainAddOutputFilterByType DEFLATE text/htmlAddOutputFilterByType DEFLATE text/xmlAddOutputFilterByType DEFLATE text/cssAddOutputFilterByType DEFLATE text/vttAddOutputFilterByType DEFLATE text/x-componentAddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE application/xhtml+xmlAddOutputFilterByType DEFLATE application/rss+xmlAddOutputFilterByType DEFLATE application/jsAddOutputFilterByType DEFLATE application/javascriptAddOutputFilterByType DEFLATE application/x-javascriptAddOutputFilterByType DEFLATE application/x-httpd-phpAddOutputFilterByType DEFLATE application/x-httpd-fastphpAddOutputFilterByType DEFLATE application/atom+xmlAddOutputFilterByType DEFLATE application/jsonAddOutputFilterByType DEFLATE application/ld+jsonAddOutputFilterByType DEFLATE application/vnd.ms-fontobjectAddOutputFilterByType DEFLATE application/x-font-ttfAddOutputFilterByType DEFLATE application/x-web-app-manifest+jsonAddOutputFilterByType DEFLATE font/opentypeAddOutputFilterByType DEFLATE image/svg+xmlAddOutputFilterByType DEFLATE image/x-icon # Exception: ImagesSetEnvIfNoCase REQUEST_URI .(?:gif|jpg|jpeg|png)$ no-gzip dont-vary# Drop problematic browsersBrowserMatch ^Mozilla/4 gzip-only-text/htmlBrowserMatch ^Mozilla/4.0[678] no-gzipBrowserMatch bMSI[E] !no-gzip !gzip-only-text/html# Make sure proxies don't deliver the wrong contentHeader append Vary User-Agent env=!dont-vary</IfModule>## EXPIRES CACHING ##<IfModule mod_expires.c>ExpiresActive OnExpiresDefault 'access plus 1 week'ExpiresByType image/jpg 'access plus 1 year'ExpiresByType image/jpeg 'access plus 1 year'ExpiresByType image/gif 'access plus 1 year'ExpiresByType image/png 'access plus 1 year'ExpiresByType image/svg+xml 'access plus 1 month'ExpiresByType text/css 'access plus 1 month'ExpiresByType text/html 'access plus 1 minute'ExpiresByType text/plain 'access plus 1 month'ExpiresByType text/x-component 'access plus 1 month'ExpiresByType text/javascript 'access plus 1 month'ExpiresByType text/x-javascript 'access plus 1 month'ExpiresByType application/pdf 'access plus 1 month'ExpiresByType application/javascript 'access plus 1 months'ExpiresByType application/x-javascript 'access plus 1 months'ExpiresByType application/x-shockwave-flash 'access plus 1 month'ExpiresByType image/x-icon 'access plus 1 year'ExpiresByType application/json 'access plus 0 seconds'ExpiresByType application/ld+json 'access plus 0 seconds'ExpiresByType application/xml 'access plus 0 seconds'ExpiresByType text/xml 'access plus 0 seconds'ExpiresByType application/x-web-app-manifest+json 'access plus 0 seconds'ExpiresByType text/cache-manifest 'access plus 0 seconds'ExpiresByType audio/ogg 'access plus 1 month'ExpiresByType video/mp4 'access plus 1 month'ExpiresByType video/ogg 'access plus 1 month'ExpiresByType video/webm 'access plus 1 month'ExpiresByType application/atom+xml 'access plus 1 hour'ExpiresByType application/rss+xml 'access plus 1 hour'ExpiresByType application/font-woff 'access plus 1 month'ExpiresByType application/vnd.ms-fontobject 'access plus 1 month'ExpiresByType application/x-font-ttf 'access plus 1 month'ExpiresByType font/opentype 'access plus 1 month'</IfModule>## EXPIRES CACHING ###Alternative caching using Apache's mod_headers, if it's installed.#Caching of common files - ENABLED<IfModule mod_headers.c><FilesMatch '.(ico|pdf|flv|swf|js|css|gif|png|jpg|jpeg|txt|html|htm)$'>Header set Cache-Control 'max-age=2592000, public'</FilesMatch></IfModule><IfModule mod_headers.c> <FilesMatch '.(js|css|xml|gz)$'> Header append Vary Accept-Encoding </FilesMatch></IfModule><IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*</IfModule># Set Keep Alive Header# This *just* sets the header - maybe your hoster is not allowing this feature# Please check if it is working with tools like http://www.webpagetest.org<IfModule mod_headers.c> Header set Connection keep-alive</IfModule># If your server don't support ETags deactivate with None (and remove header)<IfModule mod_expires.c> <IfModule mod_headers.c> Header unset ETag </IfModule> FileETag None</IfModule>