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
120
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
620
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
1
480
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
実践!難読化ガイド
mitchan
0
160
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
120
長期運用プロダクトの開発速度を維持し続けるためのリファクタリング実践例
wataruss
8
2.7k
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
1.1k
ドメイン駆動設計を実践するために必要なもの
bikisuke
4
330
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
540
私のEbitengineの第一歩
qt_luigi
0
450
Rubyのobject_id
qnighy
6
1.3k
オートマトン学習しろ / Do automata learning
makenowjust
3
130
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
Git: the NoSQL Database
bkeepers
PRO
425
64k
A Tale of Four Properties
chriscoyier
155
22k
Visualization
eitanlees
142
15k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
401
65k
Being A Developer After 40
akosma
84
590k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Optimising Largest Contentful Paint
csswizardry
30
2.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
Designing for humans not robots
tammielis
248
25k
A better future with KSS
kneath
235
17k
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