Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加html内容压缩 #139

Merged
merged 11 commits into from
Jan 9, 2020
Merged

添加html内容压缩 #139

merged 11 commits into from
Jan 9, 2020

Conversation

laijinhang
Copy link
Contributor

开发环境:返回不压缩的html代码
生产环境:返回压缩后的html代码

开发模式:展示完整的html代码
生产环境:展示压缩的html代码
HTML content compression
@chenhg5
Copy link
Collaborator

chenhg5 commented Jan 9, 2020

@laijinhang 不压缩的意义是?压缩跟不压缩,如果前端调试用浏览器开发者工具应该也可以是不影响的?

@laijinhang
Copy link
Contributor Author

不压缩的话就是用原来的,压缩是新加的代码。因为我在使用中发现没有压缩的话,会传输大量的空格或空行数据,占用不必要的网络带宽。我试了下/admin/info/op,不压缩前40多kb,压缩之后15kb左右

@chenhg5
Copy link
Collaborator

chenhg5 commented Jan 9, 2020

不压缩的话就是用原来的,压缩是新加的代码。因为我在使用中发现没有压缩的话,会传输大量的空格或空行数据,占用不必要的网络带宽。我试了下/admin/info/op,不压缩前40多kb,压缩之后15kb左右

哦明白。你加一个单元测试吧。@laijinhang

CompressedContent可以写在 modules/utils/utlils.go 里面。

@chenhg5 chenhg5 merged commit 2dcc765 into GoAdminGroup:master Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants