Reputation: 17382
We are running our grails probject with run-app
. The first time a page is requested, there is a delay. Every time after that, however, the page loads quickly.
The most obvious explanation I can think of is that the page hasn't been compiled yet. Is there a way to induce compilation or whatever else is causing the delay?
Upvotes: 2
Views: 824
Reputation: 24776
I hope you are only using "run-app
" in development and not in production.
If you want to pre-compile the GSPs then use "run-war
".
Be aware though, changes to the GSP will not be detected and you will have to restart the application or make changes to your configuration to enable dynamic recompile.
To enable dynamic recompile of GSPs when running as a WAR modify your Config.groovy
with the following:
grails.gsp.enable.reload = true
grails.gsp.view.dir = "/path/to/WEB-INF/"
I can't stress enough, if this isn't in development, and instead is production, deploy your application as a WAR file.
Upvotes: 5