Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daan Stolp 2 posts 71 karma points
    Apr 19, 2018 @ 19:34
    Daan Stolp
    0

    Which files or mime-types to include/exclude for gzip compression?

    I am developing a small Umbraco site that will run on a shared hosting environment. I want to enable gzip compression for my HTTP responses, and I need to configure this using a .htaccess file.

    The hosting provider has provided the following code snippet for enabling gzip compression.

    <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>
    

    However, this breaks the site: the browser shows a default error message (ERRCONTENTDECODING_FAILED), suggesting that the response could not be decoded.

    I assume this can be fixed by changing which files or mime types are compressed and which are not.

    Can anyone point me in the right direction? What files or mime types do I need to include or exclude for Umbraco to work properly?

Please Sign in or register to post replies

Write your reply to:

Draft