是否可能在neo4j新版本中压缩rest api响应gzip而不使用插件?

时间:2021-01-21 18:01:18

My application receives JSON from Neo4j rest api which is quite verbose (~ 1Mb json text) due to which the application takes time to load.

我的应用程序从Neo4j rest api接收JSON,该api非常冗长(~ 1Mb JSON文本),因此应用程序需要花费时间来加载。

Is it possible to get compressed json from neo which I can use in my angular js application.

是否可以从neo获得压缩的json,我可以在我的角度js应用程序中使用它。

Neo4j 2.2.3 is installed on windows 2008 R2 with IIS on another server with 2008 windows server as well.

Neo4j 2.2.3安装在windows 2008 R2上,IIS也安装在另一台服务器上,windows server也安装在2008。

I went through: plugin and SO question

我经历过:插件和问题。

Is there any way to accomplish this without plugin but just a property like compressoin:true and decode that compression in angularjs app???

有没有一种方法可以不用插件就完成这个,而只需要一个属性,比如compressoin:true and decode这个angularjs应用程序中的压缩?

@Michael Hunger

@Michael饥饿

2 个解决方案

#1


2  

No. Currently there is no such functionality in Neo4j. And I think it won't be there in near future.

不。目前Neo4j中没有这样的功能。我认为它不会在不久的将来出现。

What other opportunities do we have?

我们还有什么机会?

Extension

First one, as you mentioned - develop extension that will gzip all our resonses. This one should be maintaned additionally, and updated for new database versions.

第一个,正如你所提到的-开发扩展,它将使我们所有的共振。另外,应该对这个数据库进行维护,并对新的数据库版本进行更新。

Nginx

You can use nginx in front of your database as reverse proxy, to compress all responses.

您可以在数据库前使用nginx作为反向代理来压缩所有响应。

Nginx is supported on windows, but considered as "beta" version.

windows支持Nginx,但被认为是“beta”版本。

There is gzip module and also guide how to use it.

有gzip模块,并指导如何使用它。

IIS

I have no experience with IIS on widows server. But it looks like that it is capable to compress responses.

我没有在寡妇服务器上使用IIS的经验。但看起来它可以压缩响应。

Some articles from first google page on "IIS gzip" query:

关于“IIS gzip”查询的第一个谷歌页面的一些文章:

Bolt

In upcoming major Neo4j relese (3.0) new binary protocol will added - bolt. This one is based on modified msgpack. That means:

在即将到来的Neo4j relese(3.0)中,新的二进制协议将增加- bolt。这是基于修改的msgpack。这意味着:

  • Responses will be smaller
  • 响应将小
  • Request will be faster
  • 请求将会更快

#2


1  

It looks like this is a pending issue in the neo4j repo:

这似乎是neo4j repo中有待解决的问题:

https://github.com/neo4j/neo4j/issues/1262

https://github.com/neo4j/neo4j/issues/1262

I don't know of a way to do this with Neo4j offhand, but you could put something like nginx in front of Neo4j to do the gzipping:

我不知道如何使用Neo4j,但是你可以在Neo4j的前面加上nginx来做gzipping:

http://nginx.org/en/docs/http/ngx_http_gzip_module.html

http://nginx.org/en/docs/http/ngx_http_gzip_module.html

#1


2  

No. Currently there is no such functionality in Neo4j. And I think it won't be there in near future.

不。目前Neo4j中没有这样的功能。我认为它不会在不久的将来出现。

What other opportunities do we have?

我们还有什么机会?

Extension

First one, as you mentioned - develop extension that will gzip all our resonses. This one should be maintaned additionally, and updated for new database versions.

第一个,正如你所提到的-开发扩展,它将使我们所有的共振。另外,应该对这个数据库进行维护,并对新的数据库版本进行更新。

Nginx

You can use nginx in front of your database as reverse proxy, to compress all responses.

您可以在数据库前使用nginx作为反向代理来压缩所有响应。

Nginx is supported on windows, but considered as "beta" version.

windows支持Nginx,但被认为是“beta”版本。

There is gzip module and also guide how to use it.

有gzip模块,并指导如何使用它。

IIS

I have no experience with IIS on widows server. But it looks like that it is capable to compress responses.

我没有在寡妇服务器上使用IIS的经验。但看起来它可以压缩响应。

Some articles from first google page on "IIS gzip" query:

关于“IIS gzip”查询的第一个谷歌页面的一些文章:

Bolt

In upcoming major Neo4j relese (3.0) new binary protocol will added - bolt. This one is based on modified msgpack. That means:

在即将到来的Neo4j relese(3.0)中,新的二进制协议将增加- bolt。这是基于修改的msgpack。这意味着:

  • Responses will be smaller
  • 响应将小
  • Request will be faster
  • 请求将会更快

#2


1  

It looks like this is a pending issue in the neo4j repo:

这似乎是neo4j repo中有待解决的问题:

https://github.com/neo4j/neo4j/issues/1262

https://github.com/neo4j/neo4j/issues/1262

I don't know of a way to do this with Neo4j offhand, but you could put something like nginx in front of Neo4j to do the gzipping:

我不知道如何使用Neo4j,但是你可以在Neo4j的前面加上nginx来做gzipping:

http://nginx.org/en/docs/http/ngx_http_gzip_module.html

http://nginx.org/en/docs/http/ngx_http_gzip_module.html