简体   繁体   English

减少Google Cloud Endpoints请求响应标头的大小

[英]Reduce Google Cloud Endpoints request response header size

I'm using a Google Cloud App Engine and Google Cloud Endpoints API for my backend for an Android app.This is all in Java. 我为Android应用程序的后端使用了Google Cloud App Engine和Google Cloud Endpoints API。全部使用Java。 I passing Json through to the backend. 我将Json传递到了后端。 When I call an API method in the Endpoints from the Android App, I get an HTTP response from the App Engine. 当我从Android App在端点中调用API方法时,我从App Engine得到了HTTP响应。 To reduce the download data load on my App I've reduced the body of the response as much as I can, i've set it up so that most of the time the message in the body is just a 'success' message and a custom ID tag. 为了减少我的应用程序上的下载数据负载,我已尽我所能地减少了响应的主体,我对其进行了设置,以便大多数情况下,主体中的消息只是一条“成功”消息,而自定义ID标签。

I'd now like to try and reduce the size of the response header if possible. 我现在想尝试尽可能减少响应标头的大小。 I haven't been able to figure this out or find much information about this online, could anyone help with this? 我一直无法弄清楚这一点,或者在网上找不到有关此信息的任何信息,有人可以帮忙吗? I'm not even sure this is possible. 我什至不确定这是可能的。

The properties in the response header seem to be set as defaults in the backend, I can't see where this is being done to try and modify it or remove some of them (assuming some of them are not absolutely necessary for the response to be delivered properly). 响应标头中的属性似乎在后端设置为默认值,我看不到在哪里进行尝试以对其进行修改或删除或删除其中一些属性(假设其中某些对于响应是绝对不是必需的)。正确交付)。 The size of the header in each response is 500 bytes.My app is sending many small messages as the users will often be making small updates to data which needs to be pushed out and so 500 bytes for each response quickly adds up. 每个响应中标头的大小为500字节。我的应用程序正在发送许多小消息,因为用户经常对需要推送的数据进行小更新,因此每个响应500字节很快就累加了。 This is especially a problem as most of my users will be away from wifi and will have somewhat low data plans on their phone. 这是一个特别大的问题,因为我的大多数用户都将无法使用wifi,并且手机上的数据套餐有些低。

Unfortunately, the Endpoints frameworks simply aren't made for this kind of optimization. 不幸的是,Endpoints框架根本不是为这种优化而设计的。 Are you sure it is 500 bytes after gzip compression? 确定gzip压缩后为500字节吗? How certain are you that this optimization is necessary? 您如何确定此优化是必要的?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM