Compression for SVG

Discussion in 'Suggestions and Feedback' started by AlexAnd, Nov 12, 2020.

  1. Is it possible to turn on compression for SVG files in a way it's made for text and JS files?
     
  2. Ray Huang

    Ray Huang Everleap staff

    Yes. You should be able to modify your web.config file to compress .svg files. Sample markup here.
     
  3. I've modified my web.config by adding this:

    Code:
        <httpCompression minFileSizeForComp="10" staticCompressionIgnoreHitFrequency="true">
          <scheme name="gzip" />
          <staticTypes>
            <add mimeType="image/svg+xml" enabled="true" />
          </staticTypes>
        </httpCompression>
        <urlCompression doStaticCompression="true" doDynamicCompression="true" />
    
    It does work, but not always - it looks like my website sends it compressed only when I reload the page to the browser. Compression for JS files works all the time. Should I specify any other parameters there?
     
    Last edited: Nov 12, 2020
  4. Ray Huang

    Ray Huang Everleap staff

    Please see this link. I vaguely remember it has something to do with the frequency of the requests.
     
  5. Thank you, your link helped a lot. It seems, that this:
    Code:
    <httpCompression staticCompressionIgnoreHitFrequency="true">
    
    is useless. Only this:
    Code:
    <serverRuntime frequentHitThreshold="1" frequentHitTimePeriod="23:59:59" />
    
    works.
     
    Ray Huang likes this.

Share This Page