ResponseCache 512kb limit applied to gzipped responses

Hello together,

I have a response with 1.4mb in size. From the documentation I know that 512kb is the limit for the ResponseCache policy so I thought when gzip is applied (which shrinks the response to 177kb) the responses are cached.

Thats actually not what happened. Small responses get cached quite fine but the bigger ones dont. So I guess the limit constraint is applied to the actual response and not the gzipped one (which means that Apigee unpacks it).

Is this the intended behavior? Is there a workaround without doing Javascript magic or do we have to cache it on target side?

Thanks in advance,

Alex

Solved Solved
0 1 322
1 ACCEPTED SOLUTION

That is correct. Limit applies to the actual response and not the compressed one. Here is a good explanation and exercise about how it works https://community.apigee.com/answers/2030/view.html

I'd suggest to either compress the data before sending it to Apigee or use streaming https://docs.apigee.com/api-platform/develop/enabling-streaming

Here's an anti-pattern in case compression isn't possible https://docs.apigee.com/api-platform/antipatterns/caching-large

View solution in original post

1 REPLY 1

That is correct. Limit applies to the actual response and not the compressed one. Here is a good explanation and exercise about how it works https://community.apigee.com/answers/2030/view.html

I'd suggest to either compress the data before sending it to Apigee or use streaming https://docs.apigee.com/api-platform/develop/enabling-streaming

Here's an anti-pattern in case compression isn't possible https://docs.apigee.com/api-platform/antipatterns/caching-large