Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Gzip And Minifiy Rate Topic   - - - - -

 
  • jshindl
  • Newbie
  • Members
  • Join Date: 01-Dec 16
  • 1 posts

Posted 01 December 2016 - 03:25 PM #1

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.c...html.html?sl=enbut it seems to not do anything. Any tips for Minifying the HTML?

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 01 December 2016 - 07:05 PM #2

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?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • gleb.goncharov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 04-Oct 13
  • 351 posts

Posted 02 December 2016 - 10:50 PM #3

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



 
  • dotell
  • Junior Member
  • Trial users
  • Join Date: 21-Oct 09
  • 218 posts

Posted 04 December 2016 - 09:49 PM #4

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.



 
  • dotell
  • Junior Member
  • Trial users
  • Join Date: 21-Oct 09
  • 218 posts

Posted 04 December 2016 - 10:53 PM #5

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



 

Posted 06 January 2018 - 05:21 PM #6

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