Gzip And Minifiy

Hello,

We're trying to Minify and Gzip the HTML that CS Cart 4.3.9 creates.

For Gzip, I've tried various versions of htaccess hacks, but none seem to actually change the gzip compressing on the HTML file. I've even tried editing the index.php with ob_start("ob_gzhandler"); but nothing seems to actually change it. Has anyone had success enabling gzip on CS Cart 4.3.9? if so, how?

Also, for Minify I installed http://marketplace.cs-cart.com/add-ons/integrations/minify-html.html?sl=enbut it seems to not do anything. Any tips for Minifying the HTML?

I believe that zipping html is part of the standard .htaccess config. Hence, if it's already zipped you won't see any improvement in size. In fact, it could get bigger since compressing a text file is more compressable than compressing a binary file (a file that has already been compressed).

Why are you trying to do this at the application layer rather than letting the transport layer do it for you?

Hello,

We're trying to Minify and Gzip the HTML that CS Cart 4.3.9 creates.

For Gzip, I've tried various versions of htaccess hacks, but none seem to actually change the gzip compressing on the HTML file. I've even tried editing the index.php with ob_start("ob_gzhandler"); but nothing seems to actually change it. Has anyone had success enabling gzip on CS Cart 4.3.9? if so, how?

Also, for Minify I installed http://marketplace.cs-cart.com/add-ons/integrations/minify-html.html?sl=enbut it seems to not do anything. Any tips for Minifying the HTML?

Hello, I suppose you should use compression on a web server level rather than implement it in the source code. In case you want to use prepared gzippped static content (such as images, styles and so forth) and store it on the disk instead of doing it on the fly and spend CPU ticks, I recommend you to use gzip_static module in NGINX. Also if you worried about performance, try to use brotli compression algorithm, which might be better than gzip on your data.

I'm using 4.3.10 and after I moved to PHP7, GTmetrix score went down telling me that I need to enable Gzip and minify html. Are you using php7 also? I'm trying to figure out why as well.

My issues were solved after a server tech did this:

I enabled gzip compression server wide, by adding rules in the apache include file '/etc/apache2/conf.d/includes/pre_main_global.conf'.

I believe that zipping html is part of the standard .htaccess config. Hence, if it's already zipped you won't see any improvement in size. In fact, it could get bigger since compressing a text file is more compressable than compressing a binary file (a file that has already been compressed).

Why are you trying to do this at the application layer rather than letting the transport layer do it for you?

Can you suggest a post or some details on how to optimize cs cart. I'm using 4.3.3.

Thanks in advance