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

3

11

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?

Hageman answered 28/5, 2012 at 0:3 Comment(0)
I
6

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

Impartial answered 28/5, 2012 at 17:20 Comment(3)
Looks good. Any idea how to do it for static files in public directory - like HTML?Hageman
You'd need to wrap the Controller that serves static content. I haven't look into how to do that. Sorry.Impartial
Here's my attempt at minifying and gzipping static resources. Seems to work ok for me: gist.github.com/2882360Hageman
H
6

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

Hageman answered 6/6, 2012 at 15:2 Comment(0)
P
5

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

Pacifica answered 28/5, 2012 at 0:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.