Forum Discussion
SVG files not being compressed
I am attempting to enable http compression for svg images. I have added the content-type image/svg+xml to the compression content-list but when I do a curl command with -H 'Accept-Encoding: gzip,deflate' I still do not get back a content-encoding gzip header. However, it is working correctly for other types like js and css. Am I missing something here?
- What_Lies_Bene1
Cirrostratus
The plus sign is probably causing an issue.
Try entering this (assuming you are using the GUI):
"image/svg+xml"
I say this as the default mimetype application/(xml|x-javascript) is listed in the configuration file as
- with double quotes."application/(xml|x-javascript)"
- David_Michael_1
Nimbostratus
Thanks, plus sign was the issue. We had to escape it and that solved the issue.
- George_Efimoff_
Nimbostratus
Hi! Apologies for bringing up the topic again, but could you kindly publish the specific example of proper escaping which works 100%, please? I tried various things, none worked, i.e. image/svg\x2Bxml, image/, image/svg
- JG
Cumulonimbus
image/svg\+xml
- George_Efimoff_
Nimbostratus
Hi Jie!
Unfortunately it did not work. Following I found not working as well: image/svg+xml ^image/.* or, even image/
Thanks a lot for your help!
- George_Efimoff_
Nimbostratus
Finally, with F5's help, made it work. It looks like + sign, even quoted, complicates the things. So, working content entry, in the end, was image/svg and noting else with svg in the list. In my case:
content-type-exclude { image/gif image/jpeg image/png } content-type-include { text/ "application/(xml|x-javascript|javascript)" image/svg font/woff2 image/ }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com