How to Enable GZIP compression on Play Framework 1 app on Heroku Cedar?

余生颓废 提交于 2019-11-29 12:44:22

问题


I'd like to enable GZIP compression for public assets and HTTP responses for performance. My site has a lot of mobile access.

As far as I can tell, there is nothing built into Play Framework to support this, and Heroku doesn't seem to have a solution either.

What is the best way to start getting some compression on my app?


回答1:


Check out: https://gist.github.com/1317626




回答2:


Ok I've had a go at minifying and gzipping all STATIC resources - nobody seems to have attempted this yet.

Play provides a hook by means of a plugin, but it seems a little hacky as you have to set all the caching headers and stuff.

Seems to work so far though:

https://gist.github.com/2882360




回答3:


Check Minifymod module: http://www.playmodules.net/module/7



来源:https://stackoverflow.com/questions/10778127/how-to-enable-gzip-compression-on-play-framework-1-app-on-heroku-cedar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!