assetic in the real world

assetic in the real world

Web performance is getting more important as mobile usage increases. Combining and minifying assets is one way to speed up page load. PHP offers the assetic library which takes care of most asset processing needs through filters. This talk gives an introduction into assetics, the benefits and challenges you'll encounter and finishes with some ideas on how to make asset processing better.

Db6218c1b56d64e775eb79ea4f2889dd?s=128

Sebastian

May 15, 2013
Tweet

Transcript

  1. 15.05.2013 assetic in the real world @Sgoettschkes #viennaphp 15.05.2013

  2. 15.05.2013 Assets? css javascript images sass less coffeescript sprites compression

  3. 15.05.2013 What to do? ✔ Remove comments / unneeded code

    ✔ compress code (remove newlines) ✔ combine files (one css, one js) ✔ Sprite images
  4. 15.05.2013 Why? Performance! (and ease of development)

  5. 15.05.2013 kriswallsmith/assetic { "require": { "kriswallsmith/assetic": "1.0.4" } }

  6. 15.05.2013 kriswallsmith/assetic Two usage ways: „Dynamic asset server“ (development) „Static

    asset generator“ (production)
  7. 15.05.2013 Some example code https://github.com/viennaphp/assetic-real-world

  8. 15.05.2013 Problems? dev prod easy debugging performance changing fast „static“

    vs.
  9. 15.05.2013 Debugging vs. Performance Best approach: Serve uncombined in dev,

    combined in staging & prod
  10. 15.05.2013 Changing vs. static ✔ Watch/regenerate static assets... ✔ ...or

    generate on every request (asset server)
  11. 15.05.2013 symfony/assetic-bundle ✔ Configuration through config.yml ✔ twig integration ✔

    dev/prod mode ✗ Unexpected behaviour / buggy(?) ✗ asset generation on the fly very slow
  12. 15.05.2013 Some more example code

  13. 15.05.2013 My wishlist ✔ Easier setup ✔ Faster on-the-fly ✔

    Integration of javascript framework
  14. 15.05.2013 Thanks @Sgoettschkes http://sebastian.goettschkes.de