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
120
Cloud native apps with Spring Cloud
bclozel
1
670
HTTP2 for the web developer devoxx
bclozel
0
170
HTTP2 for the web developer
bclozel
1
120
Inside http://spring.io
bclozel
1
280
Intro to Spring Boot
bclozel
4
2.4k
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
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
6
890
GitHub Copilotのススメ
marcy731
0
190
今、知っておきたい! 生成AIエージェントの世界
elith
3
350
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
250
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
200
Goのmultiple errorsについて (2024年4月版)
syumai
1
340
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.3k
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
360
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
雑に思考を整理する技術と効能
konifar
58
28k
Java 22 Overview
kishida
1
180
Featured
See All Featured
Producing Creativity
orderedlist
PRO
336
39k
The Cost Of JavaScript in 2023
addyosmani
15
3.8k
Thoughts on Productivity
jonyablonski
57
3.8k
How to name files
jennybc
64
93k
Facilitating Awesome Meetings
lara
41
5.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
356
22k
Teambox: Starting and Learning
jrom
128
8.4k
A better future with KSS
kneath
231
16k
Atom: Resistance is Futile
akmur
258
25k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
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