Jump to content

prestashop 1.5 gzip compration


Recommended Posts

You need to edit the .htaccess file that's in the root PrestaShop directory on your hosting account. You should be able to do that using the control panel of your account. If you don't have an .htaccess file, you need to create one. Again, you should be able to do that from the control panel.

 

When you edit the file you can put in it something like this:

 

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
AddOutputFilterByType DEFLATE application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
</IfModule>

Edited by hxd (see edit history)
Link to comment
Share on other sites

Thank you,

 

I see that my already has in the .htaccess file, the folowing

<IfModule mod_deflate.c>

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

</IfModule>

 

But gzip test online tools or google page speed insights, state that i have no compression.

What i'm i doing wrong ?

Link to comment
Share on other sites

  • 3 months later...

Great, I am glad I could help.

Hello, I would like to ask you one question regarding this topic.

ON http://www.whatsmyip...mpression-test/ - it shows me, that my page is gzipped

Original Size: 24.3 KB

Compressed Size: 6.59 KB

Data Savings: 72.88%

BUT on this site - https://developers.g...espeed/insights - it shows me that I should enable compression - Compressing the following resources with gzip could reduce their transfer size by 193.3KiB (71% reduction)......which doesn´t make sence right?

 

One thing- I didn´t make any changes in .htaccess ( this file was already created by PS - but there is nothing similar as you write above only this text

(# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# http://www.prestashop.com - http://www.prestashop.com/forums

 

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTP_HOST} ^my domain$

RewriteRule . - [E=REWRITEBASE:/]

RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

 

</IfModule>

 

#If rewrite mod isn't enabled

ErrorDocument 404 /index.php?controller=404

 

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

 

I have Prestashop 1.5.3.1

 

Could you pls advice me where could be problem?

Thank you much.

Edited by domorodec (see edit history)
Link to comment
Share on other sites

Hello, I would like to ask you one question regarding this topic.

ON http://www.whatsmyip...mpression-test/ - it shows me, that my page is gzipped

Original Size: 24.3 KB

Compressed Size: 6.59 KB

Data Savings: 72.88%

BUT on this site - https://developers.g...espeed/insights - it shows me that I should enable compression - Compressing the following resources with gzip could reduce their transfer size by 193.3KiB (71% reduction)......which doesn´t make sence right?

 

One thing- I didn´t make any changes in .htaccess ( this file was already created by PS - but there is nothing similar as you write above only this text

(# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# http://www.prestashop.com - http://www.prestashop.com/forums

 

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTP_HOST} ^my domain$

RewriteRule . - [E=REWRITEBASE:/]

RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

 

</IfModule>

 

#If rewrite mod isn't enabled

ErrorDocument 404 /index.php?controller=404

 

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

 

I have Prestashop 1.5.3.1

 

Could you pls advice me where could be problem?

Thank you much.

One more thing - probably this issues should be resolved with new ver. I am already using right? Cause another test on http://port80software.com/support/p80tools says:

File Size Comparison (in bytes): Original size: 24886 bytes

Compressed size: 6746 bytes

Savings in bytes: 18140 bytes

 

Percentage saved by compression: 73.0% Transfer speed improvement:

3.6 X

 

Well.....

Link to comment
Share on other sites

  • 7 months later...
  • 3 months later...

How can I enable compression to themes/default/cache ?
this is what i get from PageSpeed Insights and gtmetrix.com:

Compressing the following resources with gzip could reduce their transfer size by 247.8KiB (73% reduction).

 

My prestashop version is: 1.5.6.2 (Default theme)

 

Best regards.

Edited by majority (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...