Welcome Guest, Not a member yet? Register   Sign In
Gziping
#11

[eluser]CroNiX[/eluser]
Here are the .htaccess rules I use for gzipping. It avoids the browsers that can't handle it.
Code:
<IFModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ 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
</IFModule>
#12

[eluser]RS71[/eluser]
Thanks guys

I currently have my .htaccess as:

Code:
<IFModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ 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
</IFModule>

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ "index.php/$1" [L]

the code that CroNiX posted seems to be GZipping js as well. Please excuse my lack of knowledge on the subject but:

Lets say the user loads a page with a GZipped js file then goes on to another page that uses the same file. On the other page, the user would still use the js from cache even it being GZipped and all?
#13

[eluser]CroNiX[/eluser]
According to Firebug, yes.
#14

[eluser]pistolPete[/eluser]
The use of gzip / deflate here is just use for file transmission.
The server compresses the file, sends it to the browser which instantly decompresses it.
#15

[eluser]RS71[/eluser]
Thanks for the help guys, I appreciate it.




Theme © iAndrew 2016 - Forum software by © MyBB