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.
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.
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?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 fileCode: 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>
Cool. Could I also use this Optimize Website feature in my cPanel?
Attachments
Screen shot 2010-11-19 at 7.32.21 PM.png (145.48 KiB) Viewed 6874 times
Thanks for this!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 fileCode: 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>
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.
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
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
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
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
GZIP for more efficient transfer to requesting clients. Compression level must be between 0 - 9
hope this would help
The code below should be added to your .htaccess file:
Using yslow extension in firefox to check whether the gzip is enabled:
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 (206.58 KiB) Viewed 4192 times
EMail: support@ocaddons.com
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
Who is online
Users browsing this forum: No registered users and 38 guests