Forum Discussion
tmsh syntax to add json to compression profile
I am trying to add "application/json" to a compression file. I can't figure out the correct syntax and a search doesn't get me anything. It's probably something simple but I am very weak when it comes to this. I am guessing based on the existing profile but no matter what I do I get syntax errors.
Existing profile that is working. ltm profile http-compression Http_compression-compression { app-service none content-type-exclude { .\.pdf .\.gif .\.bmp oriongeocodemanager.asmx .\.jpg } content-type-include { text/ "application/(xml|x-javascript)" text/.* .\.css .\.js tc } defaults-from httpcompression }
Modification which fails tmsh modify ltm profile http-compression Http_compression-compression content-type-include { text/ "application/(xml|x-javascript)" text/ "application/json" text/.* .\.css .\.js .\.png .\.htc }
Syntax Error: "{" unexpected argument
- Chris_Olson
Nimbostratus
I made a little headway but might have messed up my existing profile. I used the following syntax:
tmsh modify ltm profile http-compression Http_compression-compression c ontent-type-include add { text/ "application/(xml|x-javascript)" application/json text/.* .\.css .\.js .\. png .\.htc }
Now my profile looks like this:
ltm profile http-compression Http_compression-compression { app-service none content-type-exclude { .\.pdf .\.gif .\.bmp oriongeocodemanager.asmx .\.jpg } content-type-include { text/ "application/(xml|x-javascript)" text/. .\.css .\.js .\.png .*\.htc "(\?glob)application/(xml" | "(\?glob)x-javascript)" application/json ..css ..js ..png ..htc } defaults-from httpcompression
I don't know what "(\?glob)application/(xml" | "(\?glob)x-javascript)" means.
- Chris_Olson_172
Altostratus
I removed all content-type-include parameters by using the below: tmsh modify ltm profile http-compression Http_compression-compression content-type-include none
Now when I try to rebuild to the original config, I still get: content-type-include { text/ "(\?glob)application/(xml" | "(\?glob)x-javascript)" text/.* ..css ..js ..png ..htc }
Did I corrupt the entire profile?
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