about application.mode=prod

Asked by marc

Hi,
I am using application.mode=prod. When I want to update my website in production, I update the code and then I restart play. The problem is the "Precompiling..." occurs which starts to take a lot of time as the server it is running on is not really good. So my website is down the time of all this process. Is there a way I can compile the code before I start the application?

Cheers,
Marc

Question information

Language:
English Edit question
Status:
Solved
For:
play framework Edit question
Assignee:
No assignee Edit question
Solved by:
marc
Solved:
Last query:
Last reply:
Revision history for this message
Jean-Francois POUX (jfp-taldius) said :
#1

Hi,

When running play in production mode, play will create a tmp folder in your app, and create a byte code cache there. The first time the application is started, it takes some time for play compile/write this cache. Following restarts should be faster, as play will only determine if parts need to be recompiled. So unless I'm forgetting something, if you run the app in prod mode on your machine, tar it to your server, the first startup should be faster. Btw, this feature is experimental. Should play mess up its cache, you could run play clean [your app] to remove the cache.

Revision history for this message
marc (marc-ttux) said :
#2

Ok, that's a solution. I'll start it up on my machine in prod mode and then will create a tar which I will then upload on the server. Wouldn't it be possible to have something like: play compile my_app which doesn't start up the app but just prepare it to start quickly?