Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Static Resources Management with Spring

Static Resources Management with Spring

(Workshop)

Brian Clozel

April 30, 2015
Tweet

More Decks by Brian Clozel

Other Decks in Programming

Transcript

  1. Getting  started $  open  http://bit.ly/resourcehandling   $  git  clone  http://github.com/bclozel/…

      $  git  fetch  -­‐-­‐all   $  cd  angularjs  &&  mvn  package
  2. Resource  Handling  <  4.1 • Serve  static  resources  from  *any*

     Spring   Resource  location   • Basic  Cache  header  management   • Easy  to  configure 5
  3. Remaining  questions • optimize  (concatenate,  minify)   • transform  (LESS,

     coffeescript,  gzip)   • front-­‐end  optimization  (cache  busting  URLs,   concatenate,  minify)     • development  experience 7
  4. Sources  of  inspiration • a  complete  asset  pipeline  built  into

     Spring  MVC   • fingerprinting  URLs  for  cache  busting   • client  side  dev  in  Sagan  project 9
  5. Why  not  an  asset  pipeline? • runtime  vs.  build  time

     approach   • languages  and  tools  evolve  *fast*   • ES6,  HTTP/2 10
  6. 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
  7. VersionResourceResolver • VersionStrategies:   • ContentVersionStrategy  (md5  hashes)   •

    FixedVersionStrategy  (version  string  as  a   path  prefix) 17