Post by HTMLCSSNoob » Fri Nov 19, 2010 7:40 pm

I'm working on increasing my page speed and would just like to ask if anyone recommends using the gzip function in the admin panel. I checked around on the forums, and it seems like several people were having problems with the gzip feature, but it mainly seems like it was on older versions of the cart. I'm using 1.4.9.2 and would like to know if there are any known issues with the gzip feature or if everything's been ironed out with it.

Also, I see Q recommended setting it at 4. But as it goes from 0-9, i'm wondering why 4 is the best number? Would it be a problem if you set it higher? I'm just trying to get the fastest page speed without destroying my site. :D

Active Member

Posts

Joined
Fri Aug 20, 2010 7:53 am

Post by JAY6390 » Fri Nov 19, 2010 7:54 pm

The higher the number the longer it takes to zip it. If you have mod_deflate you can just put the following at the top of your .htaccess file

Code: Select all

Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2100 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/javascript text/plain text/xml application/xml text/css application/x-javascript application/javascript
</IfModule>

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by HTMLCSSNoob » Fri Nov 19, 2010 8:02 pm

JAY6390 wrote:The higher the number the longer it takes to zip it. If you have mod_deflate you can just put the following at the top of your .htaccess file

Code: Select all

Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2100 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/javascript text/plain text/xml application/xml text/css application/x-javascript application/javascript
</IfModule>
Cheers mate, thanks a bunch for that. I'm not sure if I have Mod_Deflate, but I'm assuming I do. I'm with a pretty up to date hosting company. So would I do this on top of using the Gzip feature in the OpenCart admin panel, or would I just do one or the other?

Active Member

Posts

Joined
Fri Aug 20, 2010 7:53 am

Post by JAY6390 » Fri Nov 19, 2010 8:09 pm

Just do this one. It will do more than OC will since it will gzip your JS and css files too making them a lot smaller

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by HTMLCSSNoob » Fri Nov 19, 2010 8:34 pm

Cool. Could I also use this Optimize Website feature in my cPanel?

Attachments

Screen shot 2010-11-19 at 7.32.21 PM.png

Screen shot 2010-11-19 at 7.32.21 PM.png (145.48 KiB) Viewed 6361 times


Active Member

Posts

Joined
Fri Aug 20, 2010 7:53 am

Post by JAY6390 » Fri Nov 19, 2010 8:44 pm

Yeah that will run the same thing

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by i2Paq » Fri Jan 21, 2011 8:39 pm

JAY6390 wrote:The higher the number the longer it takes to zip it. If you have mod_deflate you can just put the following at the top of your .htaccess file

Code: Select all

Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2100 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/javascript text/plain text/xml application/xml text/css application/x-javascript application/javascript
</IfModule>
Thanks for this!

Google complaint that I needed to activate gzip en after contacting my hoster this was THE solution!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by JAY6390 » Fri Jan 21, 2011 8:41 pm

No problem, that's one of the reason I had to find out about it ;)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by speedingorange » Tue Mar 08, 2011 10:18 pm

My host does not support mod_deflate unfortunately,

Their suggested solution was the following:

"Unfortunately we do not currently support mod_deflate which allows this. However, what you can do is manually compress the said CSS/JS files and upload them with an additional .gz extension so for example (file.js becomes file.js.gz) and most modern browsers will use that."

Can anyone give me some info on how to implement this? or if it is possible to say " use the js.gz file if you can else use .js??

Cheers
James

Active Member

Posts

Joined
Tue Feb 23, 2010 7:33 pm

Post by soyo » Mon Mar 14, 2011 2:43 am

I did that for awhile on a high traffic site, it has the advantage of providing compressed content, without using up CPU time to compress it. (FYI, that's why when using gzip/mod_deflate you might lower its compression from 9 down to 4-5, to balance advantages of compression with cpu load). The problem came when I needed to update those files - I had to rename them when updating to assure that end users would see the new content, so for JS and CSS files I added version numbers to them... in short, this seems like the best option (IMO) if you have a ton of traffic to avoid the CPU overhead, but you do need to be smart about it, as there is more maintenance involved for updating files, references, etc. Maybe there are ways to manage that better these days...?

1.4.9.4


New member

Posts

Joined
Wed Dec 29, 2010 12:45 am

Post by genbii » Mon Jun 02, 2014 11:41 am

i'm using opencart 1.5.4 to enable compression, just go to your opencart administration, then system-setting, click your store name, find server tab, then choose: Output Compression Level: ...
GZIP for more efficient transfer to requesting clients. Compression level must be between 0 - 9

hope this would help

Image
Genbii Toko Mainan Online


User avatar
Newbie

Posts

Joined
Sun Feb 17, 2013 9:21 am

Post by ocaddons » Wed Jun 04, 2014 11:12 pm

The code below should be added to your .htaccess file:

Code: Select all

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


Using yslow extension in firefox to check whether the gzip is enabled:

Attachments

gzip.png

gzip.png (206.58 KiB) Viewed 3679 times


Image
Image

EMail: support@ocaddons.com


User avatar
New member

Posts

Joined
Fri Dec 27, 2013 10:21 am


Post by gogoweb » Fri Jul 31, 2015 7:06 am

Image

Here is a module i made that makes it very easy to enable GTZIP on Javascript, css html files. Additionally it adds caching headers to additionally boost the speed of brwosing your store.

I hope it helps ;)

All mods | OpenCart Bulk Related Products Ultimate Edition |GeoIP hide Prices / no add to cart by country| CSS override | Direct link to checkout / skip add to cart / buy now link | AUTO pilot - reward & purchase points


New member

Posts

Joined
Sat Oct 18, 2014 6:45 pm

Who is online

Users browsing this forum: No registered users and 4 guests