Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1709,8 +1709,16 @@ Spring Boot also supports advanced resource handling features provided by Spring
allowing use cases such as cache busting static resources or using version agnostic URLs
for Webjars.

For example, the following configuration will configure a cache busting solution
for all static resources, effectively adding a content hash in URLs, such as
To use version agnostic URLs for Webjars, simply add the `webjars-locator` dependency.
Then declare your Webjar, taking jQuery for example, as `"/webjars/jquery/dist/jquery.min.js"`
which results in `"/webjars/jquery/x.y.z/dist/jquery.min.js"` where `x.y.z` is the Webjar
version.

NOTE: If you are using JBoss, you'll need to declare the `webjars-locator-jboss-vfs`
dependency instead of the `webjars-locator`; otherwise all Webjars resolve as a `404`.

To use cache bursting, the following configuration will configure a cache busting
solution for all static resources, effectively adding a content hash in URLs, such as
`<link href="/css/spring-2a2d595e6ed9a0b24f027f2b63b134d6.css"/>`:

[source,properties,indent=0,subs="verbatim,quotes,attributes"]
Expand Down