Demystifying HTTP Headers for a Better Web @ SpaceCityJS

Demystifying HTTP Headers for a Better Web @ SpaceCityJS

Ever wonder exactly what combination of Cache-Control, Last-Modified, Expires, ETag, Vary, and Pragma headers will keep your content cached by browsers just long enough? And what exactly is a HTTP 304 anyway? In this talk, you’ll learn the history behind the available HTTP caching headers, what their values mean, and how browsers and proxies react. You’ll learn the best practices on client cache invalidation, the benefits of sending a Not Modified response, and briefly talk about the changes in HTTP 2.0 (SPDY) around caching — and then you’ll put your new-found header skills to the test!

2e055eb589fb86174fd268748b0fcd30?s=128

Andrew Dunkman

March 28, 2015
Tweet

Transcript

  1. Demystifying HTTP Headers for a Better Web Andrew: @adunkman

  2. http caching

  3. shared caches

  4. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  5. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  6. Wed, 14 May 2014 22:36:20 GMT

  7. Vary: User-Agent

  8. Vary: Accept-Encoding

  9. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  10. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  11. no-cache no-store no-transform max-age s-maxage must-revalidate proxy-revalidate max-stale public private

  12. max-age must-revalidate private public

  13. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  14. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  15. Last-Modified If-Modified-Since

  16. Etag If-None-Match

  17. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  18. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  19. <link rel=“prefetch” href=“…”>

  20. Link: <url>; rel=prefetch

  21. <link rel=“subresource” … >

  22. Link: <url>; rel=subresource

  23. SPDY

  24. mod_spdy

  25. X-Associated-Content: "full-url":<priority>

  26. Expires, Vary Cache-Control Conditional Requests The Future of Caching

  27. mnot.net/cache_docs adunkman/http-cache-demo

  28. Thank you! Andrew: @adunkman