Skip to content

Conversation

@chtompki
Copy link
Contributor

This fixes #13613 by adding the ServerProperties.Tomcat entry server.tomcat.is-web-resource-caching-allowed. Which, in turn, sets on the tomcat WebResourceRoot the value isCachingAllowed. This essentially turns off the WebResource file level caching mechanics that Tomcat performs. Generally this is a configurable option, and I would like to expose it to be configurable in application.properties.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 29, 2018
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Jun 29, 2018
@philwebb
Copy link
Member

This looks like a nice addition to me. I'd perhaps suggest a different property name since the is- prefix makes for a slightly unusual setter. Perhaps we should use something like server.tomcat.webresource.allow-caching? Having a dedicated webresource nested property block might also prove useful in the future if we want to expose properties for items such as setCacheTtl.

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 29, 2018
@chtompki
Copy link
Contributor Author

Agreed on the is prefix, I was thinking server.tomcat.use-webresource-caching but forgot to add that in (thoughts there?). Don't know if I want to go with the webresource property block because its more fiddling around with the EmbeddedTomcatContext and less about web resources. I'll make the change for is -> use. Let me know if you have any more thoughts. I'm not sure if I did the integration in the "right" place, but I do know that it works.

@wilkinsona
Copy link
Member

+1 for a webresource nested property. It reflects the type on which the property is set and gives us a grouping for other resource-related properties in the future.

We should verify the behaviour with war packaging as we already customize the resource root in that case to hide the loader classes.

@chtompki
Copy link
Contributor Author

Ok, group consensus wins. I’ll head that direction. I’ll try to get moving on it this afternoon (UTC-4), as I’m AFK currently. And, generally many thanks for the pleasant discussion/contribution paradigm.

@chtompki
Copy link
Contributor Author

chtompki commented Jun 30, 2018

(Pardon the build failure there, will fix that.)

I think that last commit accomplishes what we're going for here, yeah? @wilkinsona - by "verify the behaviour with war packaging," do you mean running a .war file inside a tomcat container? I'm less familiar with the mechanics of running boot as a war. If you point me in the direction of how to test that, I'll start working on it.

(Also plan to squash commits down when you guys think we're ready to merge.)

@philwebb philwebb added this to the Backlog milestone Jul 1, 2018
@chtompki
Copy link
Contributor Author

chtompki commented Jul 1, 2018

@philwebb - should I go ahead and squash the commits down now?

@philwebb
Copy link
Member

philwebb commented Jul 4, 2018

@chtompki No, don't worry about that. We'll do it when we rebase for merge.

@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Jul 6, 2018
@wilkinsona
Copy link
Member

This is the code that we need to double-check. I think it'll be fine but want to be sure that one customisation won't trample over the other.

@chtompki
Copy link
Contributor Author

chtompki commented Jul 6, 2018

Gotcha. I’ll poke around in there in a simple project consuming my locally built 2.1.0-SNAPSHOT to see if I can see the interplay between the two different places. Further, might it be worth putting both customizations in the same place to ensure better maintainability?

@snicoll snicoll added the for: merge-with-amendments Needs some changes when we merge label Jul 9, 2018
@snicoll
Copy link
Member

snicoll commented Jul 9, 2018

When merging this one, we should make sure to update the appendix with the new property.

@chtompki
Copy link
Contributor Author

chtompki commented Jul 9, 2018

@snicoll
Copy link
Member

snicoll commented Jul 9, 2018

Yes, thank you.

@chtompki
Copy link
Contributor Author

chtompki commented Jul 19, 2018

Curious if you think that there's anything else here for me to do, while we wait in the backlog?

@wilkinsona
Copy link
Member

@chtompki I think we're good, thank you. Unless you'd like to rename the property to allow-caching rather than use-caching that you're currently proposing. I think the former's a better match for the underlying Tomcat property that's being set. No worries if not, we can take care of it when we get round to merging this.

@snicoll snicoll self-assigned this Jul 24, 2018
@snicoll snicoll changed the title fixes #13613, add server.tomcat.is-web-resource-caching-allowed Add configuration for Tomcat's cachingAllowed property Jul 24, 2018
@snicoll snicoll removed this from the Backlog milestone Jul 24, 2018
@snicoll snicoll added this to the 2.1.0.M1 milestone Jul 24, 2018
@snicoll snicoll closed this in 5fb2060 Jul 24, 2018
snicoll added a commit that referenced this pull request Jul 24, 2018
* pr/13614:
  Polish "Add configuration for Tomcat's cachingAllowed property"
  Add configuration for Tomcat's cachingAllowed property
@snicoll
Copy link
Member

snicoll commented Jul 24, 2018

Turns out we already had a resource section that actually was configuring the TTL cache so I've moved the property there and simplified the customizer by using the same code path.

@chtompki thank you very much for your first contribution to Spring Boot. This is now merged in master

@chtompki chtompki deleted the issue-13613 branch August 2, 2018 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for: merge-with-amendments Needs some changes when we merge type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accommodate for disabling Tomcat WebResource caching.

5 participants