Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Static Resources Management with Spring
Search
Brian Clozel
April 30, 2015
Programming
0
350
Static Resources Management with Spring
(Workshop)
Brian Clozel
April 30, 2015
Tweet
Share
More Decks by Brian Clozel
See All by Brian Clozel
Back from SpringOnePlatform 2019
bclozel
4
220
Intro à Spring Boot
bclozel
0
130
Cloud native apps with Spring Cloud
bclozel
1
670
HTTP2 for the web developer devoxx
bclozel
0
180
HTTP2 for the web developer
bclozel
1
130
Inside http://spring.io
bclozel
1
310
Intro to Spring Boot
bclozel
4
2.5k
Inside spring.io: a production spring reference application
bclozel
0
120
Open-sourcing http://spring.io
bclozel
1
630
Other Decks in Programming
See All in Programming
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
890
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
110
Quine, Polyglot, 良いコード
qnighy
4
640
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
320
Arm移行タイムアタック
qnighy
0
320
Outline View in SwiftUI
1024jp
1
330
cmp.Or に感動した
otakakot
2
130
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5k
GraphQLとの向き合い方2022年版
quramy
43
13k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
What's new in Ruby 2.0
geeforr
343
31k
A designer walks into a library…
pauljervisheath
203
24k
Faster Mobile Websites
deanohume
305
30k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Into the Great Unknown - MozCon
thekraken
32
1.5k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
Building Applications with DynamoDB
mza
90
6.1k
Speed Design
sergeychernyshev
24
610
Transcript
Static Resources Management workshop Brian Clozel @brianclozel
Getting started $ open http://bit.ly/resourcehandling $ git clone http://github.com/bclozel/…
$ git fetch -‐-‐all $ cd angularjs && mvn package
Brian Clozel @brianclozel http://spring.io/team/bclozel
First application 4 What could we achieve before Spring
4.1?
Resource Handling < 4.1 • Serve static resources from *any*
Spring Resource location • Basic Cache header management • Easy to configure 5
WORKSHOP PART #1
Remaining questions • optimize (concatenate, minify) • transform (LESS,
coffeescript, gzip) • front-‐end optimization (cache busting URLs, concatenate, minify) • development experience 7
AngularJS 8 First run with Resource Handling
Sources of inspiration • a complete asset pipeline built into
Spring MVC • fingerprinting URLs for cache busting • client side dev in Sagan project 9
Why not an asset pipeline? • runtime vs. build time
approach • languages and tools evolve *fast* • ES6, HTTP/2 10
Client source code layout • src/main/webapp just not adequate anymore
• client *and* server: dependency management, modularity, tests, build artifacts • client-‐side development: ctrl+S, F5 11
WORKSHOP PART #2
ES6 app 13 client-‐side build and JS module loaders
Spring 4.1 resource handling • ResourceResolver • ResourceTransformer
• ResourceUrlProvider 14
Built-‐in ResourceResolvers • PathResourceResolver • VersionResourceResolver • GzipResourceResolver
• CachingResourceResolver 15
Built-‐in ResourceTransformers • CssLinkResourceTransformer • AppCacheManifestResourceTransformer • CachingResourceTransformer
16
VersionResourceResolver • VersionStrategies: • ContentVersionStrategy (md5 hashes) •
FixedVersionStrategy (version string as a path prefix) 17
WORKSHOP PART #3
Q&A 19 …and what’s next?
What’s next? • https://github.com/bclozel/spring-‐resource-‐ handling • https://github.com/spring-‐io/sagan •
https://jira.spring.io 20