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
690
HTTP2 for the web developer devoxx
bclozel
0
180
HTTP2 for the web developer
bclozel
1
130
Inside http://spring.io
bclozel
1
330
Intro to Spring Boot
bclozel
4
2.6k
Inside spring.io: a production spring reference application
bclozel
0
130
Open-sourcing http://spring.io
bclozel
1
630
Other Decks in Programming
See All in Programming
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
Conform を推す - Advocating for Conform
mizoguchicoji
3
690
Unity Android XR入門
sakutama_11
0
160
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
3
750
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1k
Honoとフロントエンドの 型安全性について
yodaka
7
1.2k
Software Architecture
hschwentner
6
2.1k
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
2
280
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
130
color-scheme: light dark; を完全に理解する
uhyo
5
380
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Faster Mobile Websites
deanohume
306
31k
KATA
mclloyd
29
14k
Speed Design
sergeychernyshev
27
790
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
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