简体   繁体   中英

How to enable GZIP Compression on BigCommerce site

For anybody familiar with BigCommerce , I'm sure you already know whether GZIP compression is possible to configure or not on the platform. I minified my JS files and instead of them pointing to the CDN , they're looking straight to the local files because this is the only way it will update the files.

Now I want to enable GZIP for these files but I can't find where to do it(if it's even possible).

Thank you for anybody who takes the time to offer an answer!

After some further research, you actually do not have access to the .htaccess file in BigCommerce. This is because BigCommerce does not run on Apache, but it actually runs on Nginx.

Not only that but .htaccess can produce security risks, which obviously is something you want to avoid using BigCommerce.

You can however add the following code to the top of all of your pages to compress PHP:

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM