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
680
HTTP2 for the web developer devoxx
bclozel
0
180
HTTP2 for the web developer
bclozel
1
130
Inside http://spring.io
bclozel
1
320
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
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.7k
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
1.8k
Flatt Security XSS Challenge 解答・解説
flatt_security
0
730
Beyond ORM
77web
11
1.6k
선언형 UI에서의 상태관리
l2hyunwoo
0
270
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
良いユニットテストを書こう
mototakatsu
11
3.6k
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
Embracing the Ebb and Flow
colly
84
4.5k
A Modern Web Designer's Workflow
chriscoyier
693
190k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
How GitHub (no longer) Works
holman
312
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Producing Creativity
orderedlist
PRO
343
39k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
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