Enabling GZIP compression in OpenCart 1.5 Updated on August 16, 2021 by Carrie Smaha 0 Minutes, 39 Seconds to Read OpenCart comes with the ability to enable GZIP compression. GZIP compression helps your pages load faster by compressing them when they are sent to the web browser to be rendered. When using the Google Page Speed tool, they recommend using compression. GZIP compression can be enabled through your OpenCart dashboard. We do not recommend using compression unless you are on a VPS or dedicated server since enabling GZIP compression increases your server resource usage. Log into your OpenCart Dashboard Go to System > Settings Select your store by clicking “Edit” next to it Go to the “Server” Tab Go to “Output Compression Level” and set the value between 0-9 (typically 4 – 6 is recommended) Click “Save” If you need further assistance please feel free to ask a question on our support center. Share this Article Carrie Smaha Senior Manager Marketing Operations Carrie enjoys working on demand generation and product marketing projects that tap into multi-touch campaign design, technical SEO, content marketing, software design, and business operations. More Articles by Carrie Related Articles My OpenCart 3 Contact Form Won’t Send Emails Resetting your OpenCart Admin Password with the Forgot Password link Using Free Cloudflare for SSL on OpenCart 1.5 Adding your store logo to your OpenCart 1.5 website Changing your Admin Password in OpenCart 1.5 Restoring a Database Backup in OpenCart 1.5 Sending Emails to Customers through OpenCart 1.5 How to Enable SSL Connection in OpenCart 1.5 Creating a 404 error page for OpenCart Security Steps to Take After Installing OpenCart
I did a copy and paste of the code and placed it at the top of my .htaccess file and I am still receiving a 500 error.
Hello, Should the code be pasted exactly as stated above: <pre class=”code_block” style=”width: 496px; margin: -10px 0px -30px 0px; line-height: .9em”><IfModule mod_deflate.c>AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript</IfModule></pre></pre> I put that exact code in my .htacess file and got a 500 error on my site.
Hello Eboni, Here is a corrected version of the .htaccess rule provided by Jacob: <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </IfModule></pre> Thank you, John-Paul
Thanks for that link Arn, I’ve tried what they say there but, it still won’t work. I supose there’s something on the apache configuration that should be tweaked, but being a shared hosting I don’t have access to it.
Hello Danigar, Thank you for contacting us. This setting should work on our servers, but I was unable to locate an account with us to confirm. You can check that gzip is enabled by looking in your phpinfo page. Thank you, John-Paul
Hello Danigar, Sorry for the problem with Gzip. Try adding the following code under your the “AddOutputFilterByType” lines: Header set Content-Encoding x-deflate # Header set Content-Encoding compress # Header set Content-Encoding x-gzip You can find this solution discussed here. They discuss several alternatives if this option does not work. Hope that helps to resolve your problem! Regards, Arnel C.
Hello ramesh How are you testing to see if the Gzip compression has been successfully enabled? As mentioned in our an introduction to Gzip and mod_deflate guide you can use this site: https://www.whatsmyip.org/http-compression-test/ As also mentioned in that guide you can also enable Gzip compress in your .htaccess file with this: <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </IfModule></pre> Please let us know if that works for you. – Jacob