Layer7 API Management

 View Only
  • 1.  Automatically minify output messages

    Broadcom Employee
    Posted Dec 11, 2015 05:43 AM

    Hi folks

     

    Today I wanted to know if there is any option in CA API Gateway to automatically minify response messages ? Often our devs build their messages in a "human readable format" (see capture attached), but costly in terms of performance (too many useless bytes transmitted to consumers).

     

    I know we can develop a specific global policy which remove these spaces, line breaks, etc in response messages. Maybe some native option already exists.

     

    To conclude, dear policy devs, I looking forward your best practices in terms of output message optimization (like compression)

     

    Many thanks !



  • 2.  Re: Automatically minify output messages

    Posted Dec 11, 2015 09:56 AM

    I am not aware of an any JSON-specific assertion that can do this out-of-the-box but a regular expression should accomplish what you need. It might be worthwhile to submit an Idea against the Set Context Variable and Return Template Response to Requestor assertions. Perhaps these assertions can have a checkbox to enable linearization or minification.    



  • 3.  Re: Automatically minify output messages

    Broadcom Employee
    Posted Dec 13, 2015 01:13 PM

    Hi goeer03,

     

    Thank you for confirming my thoughts : such option is not natively available in the solution.

    This is not just JSON related, any serialization form of data can be concerned.

     

    As you said, this definitely can be submitted into an idea.

    Have a nice end of day



  • 4.  Re: Automatically minify output messages

    Broadcom Employee
    Posted Dec 13, 2015 01:15 PM

    Any ideas about my second derived point before closing this thread : "best practices in terms of output message optimization (like compression)"

     

    Thank you !



  • 5.  Re: Automatically minify output messages

    Broadcom Employee
    Posted Dec 13, 2015 07:06 PM

    Well, only return error code could be the cost least way.



  • 6.  Re: Automatically minify output messages

    Posted Dec 15, 2015 08:27 AM

    Can't really argue with that: If you're concerned about sending useless bytes then it might be best to return less data.    



  • 7.  Re: Automatically minify output messages

    Broadcom Employee
    Posted Jan 13, 2016 06:24 AM

    Thank you goeer03 for your feedback.

     

    Just to clarify my request : all the data which I refer to are usefull. The main point is about optimizing the exchanges between the gateway and service consumers. Maybe some actions can be taken in service development phase in order to follow this guideline. Minifying response strings is one of them, especially when it is transparent for consumer.

     

    Have a nice day