You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for versioning resources [SPR-7141] #11800
Another benefit of using a tag like spring:resource is it would encapsulate the host of the resources. In a dev environment this might be the developer's local workstation. In a production environment this might be a CDN or dedicated resource host (see how Stackoverflow.com is setup). It should be able to switch the host of the resources without changing the pages.
@Brian: did you close this as a duplicate of #12401 or which one? In case of #12401, I think there's a difference between those two: #7745 is about serving variants of a ressource while this one is about generating different URLs for the same resource with the benefit of a maximum caching time on client side. So they both require some means for URL generation but this one requires a special resolver, too.
I don't know if Spring should support either of one because in the end this would require some kind of preprocessing to make it perfect e.g., to cache images referenced from CSS. And there are already some solutions out there (jawr, wro4j, ...) but all of them require a special runtime setup or there's no Gradle integration for the preprocessing. So it would be terrific to have a Gradle task for generating checksums and URL rewriting + a taglib for access + a Spring resolver for all this but then it might be easier to improve the Spring and Gradle integration of Jawr!
Activity
spring-projects-issues commentedon Apr 27, 2010
Keith Donald commented
Ideas:
Tag based:
or EL function based:
Need a pluggable ${version} resolver mechanism (timestamp-based strategy, property based strategy)
Version number should be optional; don't cache if version number not provided e.g. /resources/foo.css
spring-projects-issues commentedon Apr 27, 2010
Keith Donald commented
Another benefit of using a tag like spring:resource is it would encapsulate the host of the resources. In a dev environment this might be the developer's local workstation. In a production environment this might be a CDN or dedicated resource host (see how Stackoverflow.com is setup). It should be able to switch the host of the resources without changing the pages.
spring-projects-issues commentedon Apr 17, 2014
Robin Sander commented
@Brian: did you close this as a duplicate of #12401 or which one? In case of #12401, I think there's a difference between those two: #7745 is about serving variants of a ressource while this one is about generating different URLs for the same resource with the benefit of a maximum caching time on client side. So they both require some means for URL generation but this one requires a special resolver, too.I don't know if Spring should support either of one because in the end this would require some kind of preprocessing to make it perfect e.g., to cache images referenced from CSS. And there are already some solutions out there (jawr, wro4j, ...) but all of them require a special runtime setup or there's no Gradle integration for the preprocessing. So it would be terrific to have a Gradle task for generating checksums and URL rewriting + a taglib for access + a Spring resolver for all this but then it might be easier to improve the Spring and Gradle integration of Jawr!
spring-projects-issues commentedon Apr 17, 2014
Brian Clozel commented
Hello Robin Sander, this is closed as a duplicate of #15561 (and its subtasks).
There is already something in master for this case (and a much broader, extensible, mechanism for resolving/generating URLs for resources).
Please comment on #15561 if you've got feedback on that implementation.
Thanks!
spring-projects-issues commentedon Apr 17, 2014
Robin Sander commented
Thanks Brian, sounds promising!