I have been told that i need to use this htaccess to inprove response time and also for less server strain on LP
is it safe to use and will it help you think... seems to be some talk about gzip not sure if it applies to LP or not..
do you see any potential security risk here.
it comes in three parts.
part 1
Let’s start with content compression. It is generally a good idea to compress everything except the binary data. The following code will handle all the compression related stuff. It will also check for old browsers not supporting compression and will act accordingly.
# Below uses mod_deflate to compress text files. Never compress binary files.
02 <IfModule mod_deflate.c>
03 SetOutputFilter DEFLATE
04 # compress content with type html, text, js, and css
05 AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/x-javascript
06 <IfModule mod_headers.c>
07 # properly handle requests coming from behind proxies
08 Header append Vary User-Agent
09 </IfModule>
10 </IfModule>
11
12 # Properly handle old browsers that do not support compression
13 <IfModule mod_deflate.c>
14 BrowserMatch ^Mozilla/4 gzip-only-text/html
15 BrowserMatch ^Mozilla/4\.0[678] no-gzip
16 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
17 # Explicitly exclude binary files from compression just in case
18 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|pdf|swf|ico|zip)$ no-gzip
19 </IfModule>
part 2
Next, we will instruct the browser to cache the files which won’t be changing regularly. This way, browsers will utilize the copy they already have. A lot of bandwidth and time can be saved with this setting.
# Set long expire headers for better browser caching
02 <IfModule mod_expires.c>
03 ExpiresActive On
04 ExpiresByType text/css "access plus 30 days"
05 ExpiresByType text/javascript "access plus 7 days"
06 ExpiresByType application/x-javascript "access plus 7 days"
07 ExpiresByType application/javascript "access plus 7 days"
08 ExpiresByType image/x-icon "access plus 7 days"
09 ExpiresByType image/vnd.microsoft.icon "access plus 7 days"
10 ExpiresByType image/png "access plus 30 days"
11 ExpiresByType image/gif "access plus 30 days"
12 ExpiresByType image/jpeg "access plus 30 days"
13 ExpiresByType image/jpg "access plus 30 days"
14 ExpiresByType application/x-shockwave-flash "access plus 30 days"
15 </IfModule>
part 3
We will also turn off ETags and force the browser to rely on our cache control settings above.
Header unset ETag
2 FileETag None