tonylefler tonylefler - 10 months ago 58
Groovy Question

Disable Caching in Tomcat Grails

I need to disable caching during development. Currently I have to rerun the

command every time I make changes to JS or CSS (which takes 5-10 minutes). This legacy project I inherited is using Grails with embedded Tomcat.

Examples online talk about configuring Tomcat within a
hook inside the

eventConfigureTomcat = { tomcat ->

but I can't find any documentation on how to apply

<Context className="org.apache.catalina.core.StandardContext"

Please keep in mind that I'm a complete Java noob - just looking for someone to point me in the right direction.

jja jja
Answer Source

You didn't specify your Grails version. Starting at 2.3 you need to add -reloading e.g.

grails -reloading run-app

This works for me and serves the changed files, as long as the browser is actually making requests and not caching things itself.

In 3.x this may no longer be needed but there are config options for reloading that may be excluding your js/css. Search the docs for "reloading" for details.