0

I use Opencart ecommerce software version OC2. When I measure the Google's pagespeed Insights for my website, I get the following complaint about my journal-icons.svg file which allows me to use certain icons at my site:

Enable compression for the following resources to reduce their transfer size by 110.7KiB (72% reduction).
Compressing /catalog/view/theme/journal2/css/icons/fonts/journal-icons.svg could save 110.7KiB (72% reduction).

According to the provider of my template, this file is needed and can not be compressed. The file is 154 kB.

Are there any workarounds to avoid this complaint? For example filtering this file in order to keep only the code for the icons used and deleting the others?

According to an extract from my htacces file below, I understand that svg files are accessible for compression (but I'm really not a technician in this field):

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(\/?((catalog)|(assets)).+)\.js$ assets/script.php?l=4&p=$1&c=604800 [NC,L]
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml
AddType application/x-font-woff .woff
AddOutputFilterByType DEFLATE application/x-font-woff

Is there anybody who could help me out or have suggestions?

Regards SabKo

SabKo
  • 57
  • 10
  • Check if Apache serves SVG with the proper MIME type: Open up your browser's developer tools and see what's being served out. Also verify that mod_deflate is working (does anything else get compressed, HTML/CSS/etc.?). And do check that your .htaccess file is being processed to begin with. Some useful further leads here: http://stackoverflow.com/questions/21356811/how-to-send-compressed-deflated-svg-via-apache2 – Markus AO Dec 29 '16 at 21:17
  • 1
    Hello Markus, Thanks for your help. I checked my online htacces file and apparantly the instructions "Addtype image/svg+xml .svg" and "AddOutputFilterByType DEFLATE image/svg+xml" were not present anymore. The backend website opimisation module for Opencart I use, seems to change my htaccess without me being aware of that. I have add the 2 lines as proposed in your link and now the complaint is gone! Thanks a lot! – SabKo Dec 29 '16 at 21:50

0 Answers0