Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools impact on http cache headers in production #7014

Closed
fseebach opened this issue Sep 25, 2016 · 4 comments
Closed

DevTools impact on http cache headers in production #7014

fseebach opened this issue Sep 25, 2016 · 4 comments
Labels
type: bug A general bug
Milestone

Comments

@fseebach
Copy link

fseebach commented Sep 25, 2016

If devtools is included in the packaged jar and you run it with java -jar ... cache headers behave differently than without devtools.

How to reproduce:

  • mvn install the attached project.
  • run app with java -jar
  • open in browser (authenticate with default password)
  • refresh page
    The javascript file loaded by index.html is cached by the browser. CORRECT.

Now remove <excludeDevtools>true</excludeDevtools> from pom.xml, rebuild and try again.

The javascript file is no longer cached because the server response headers disallows caching.

The docs of spring boot dev tools states that devtools is disabled when run as java -jar ....

"Developer tools are automatically disabled when running a fully packaged application."

So there should be no impact by having spring boot dev tools on classpath in production?!?

devtoolscache.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 25, 2016
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 19, 2016
@philwebb philwebb added this to the 1.4.2 milestone Oct 19, 2016
@philwebb
Copy link
Member

The DefaultRestartInitializer currently performs the checks to see if devtools restart is enabled, but we've not extended this to DevToolsPropertyDefaultsPostProcessor. I'm not sure if changing this logic will break remote devtools support. We may just need to fix the documentation.

@fseebach
Copy link
Author

#7170 changes the default behavior.. so maybe only the documentation needs to state that enabling it has several impacts even if run as java -jar?!

IMHO its a bit more complex. Normally i would like to use the exactly same JAR in test,qa and production. Thats not possible at the Moment if i want to use remote dev tools support in test/qa but not in production. For that i would prefer to be able to enable or disable devtools based on the environment the application is run in. But that would presume that disabled MEANS disabled!

@wilkinsona
Copy link
Member

@fracoon Why do you want to use remote dev tools support in test/QA?

@fseebach
Copy link
Author

I don't at the moment... And if I think about it again.. There's no reason to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants