MyBB Community Forums

Full Version: Gzip files?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Dear Community

Can anyone tell me if I gzip the files on Cpanel, and now I have two files.

prototype.js
prototype.js.gz

Can I now delete the prototype.js file and only use the prototype.js.gz for a faster page speed?

Thanks for the help!

-N.
You're better off enabling gzip compression.

ACP > Configuration > Server and Optimization Options > Use GZip Page Compression? > Yes
(2012-07-14, 11:23 AM)Nathan Malcolm Wrote: [ -> ]You're better off enabling gzip compression.

ACP > Configuration > Server and Optimization Options > Use GZip Page Compression? > Yes

Ok, thank you for the answer.
But should I leave it at '4' or change to '9'?

And if its enabled, can I compress the files to js.gz and delete the .js files?

Thanks for the help!

N.
(2012-07-14, 12:52 PM)Niggidea Wrote: [ -> ]Ok, thank you for the answer.
But should I leave it at '4' or change to '9'?

4 is fine. You might experience issues if you set it too high.

(2012-07-14, 12:52 PM)Niggidea Wrote: [ -> ]And if its enabled, can I compress the files to js.gz and delete the .js files?

There's no need to do that. Enabling gzip compression will compress the data sent to the browser so you don't have to make any changes to the files.
Thanks againSmile
But if test my Google Pagespeed they tell me to gzip the files to make it faster, but if it makes it itself it should be fine than, greatSmile
You can use 1 as the level compression. There is not much difference between 1 and 9 and higher the number higher the resources you need.
(2012-07-14, 12:56 PM)Nathan Malcolm Wrote: [ -> ]
(2012-07-14, 12:52 PM)Niggidea Wrote: [ -> ]Ok, thank you for the answer.
But should I leave it at '4' or change to '9'?

4 is fine. You might experience issues if you set it too high.

(2012-07-14, 12:52 PM)Niggidea Wrote: [ -> ]And if its enabled, can I compress the files to js.gz and delete the .js files?

There's no need to do that. Enabling gzip compression will compress the data sent to the browser so you don't have to make any changes to the files.

Are you sure about that Nathan? The internal GZip setting only compresses the HTML output, not the physical files like your external CSS and external JS surely?

@OP: Best thing to do is enable compression at the server level via .htaccess:

<IfModule mod_mime.c>
    AddType text/css .css
    AddType application/x-javascript .js
    AddType text/x-component .htc
    AddType text/html .html .htm
    AddType text/richtext .rtf .rtx
    AddType image/svg+xml .svg .svgz
    AddType text/plain .txt
    AddType text/xsd .xsd
    AddType text/xsl .xsl
    AddType text/xml .xml
    AddType video/asf .asf .asx .wax .wmv .wmx
    AddType video/avi .avi
    AddType image/bmp .bmp
    AddType application/java .class
    AddType video/divx .divx
    AddType application/msword .doc .docx
    AddType application/vnd.ms-fontobject .eot
    AddType application/x-msdownload .exe
    AddType image/gif .gif
    AddType application/x-gzip .gz .gzip
    AddType image/x-icon .ico
    AddType image/jpeg .jpg .jpeg .jpe
    AddType application/vnd.ms-access .mdb
    AddType audio/midi .mid .midi
    AddType video/quicktime .mov .qt
    AddType audio/mpeg .mp3 .m4a
    AddType video/mp4 .mp4 .m4v
    AddType video/mpeg .mpeg .mpg .mpe
    AddType application/vnd.ms-project .mpp
    AddType application/x-font-otf .otf
    AddType application/vnd.oasis.opendocument.database .odb
    AddType application/vnd.oasis.opendocument.chart .odc
    AddType application/vnd.oasis.opendocument.formula .odf
    AddType application/vnd.oasis.opendocument.graphics .odg
    AddType application/vnd.oasis.opendocument.presentation .odp
    AddType application/vnd.oasis.opendocument.spreadsheet .ods
    AddType application/vnd.oasis.opendocument.text .odt
    AddType audio/ogg .ogg
    AddType application/pdf .pdf
    AddType image/png .png
    AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
    AddType audio/x-realaudio .ra .ram
    AddType application/x-shockwave-flash .swf
    AddType application/x-tar .tar
    AddType image/tiff .tif .tiff
    AddType application/x-font-ttf .ttf .ttc
    AddType audio/wav .wav
    AddType audio/wma .wma
    AddType application/vnd.ms-write .wri
    AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
    AddType application/zip .zip
</IfModule>

<IfModule mod_deflate.c>
    <IfModule mod_setenvif.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    </IfModule>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
    </IfModule>
</IfModule>
(2012-07-14, 03:29 PM)euantor Wrote: [ -> ]
(2012-07-14, 12:56 PM)Nathan Malcolm Wrote: [ -> ]There's no need to do that. Enabling gzip compression will compress the data sent to the browser so you don't have to make any changes to the files.

Are you sure about that Nathan? The internal GZip setting only compresses the HTML output, not the physical files like your external CSS and external JS surely?

I wasn't referring to enabling just the setting, but enabling gzip compression at server level. There's no need compress each physical resource on the server as the server can do that for you. Smile
Oh! Makes sense now Wink I didn't think you'd make a mistake like that but thought it best to be sure.
I am confused now, should I just keep it enabled in the acp or also change the .htaccess?
Sorry, english isn't my language.
Pages: 1 2