Caching for Cash, part 4 DPC 2009
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Caching for Cash, part 4 DPC 2009

on

  • 1,738 views

 

Statistics

Views

Total Views
1,738
Views on SlideShare
1,738
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • The user’s perception is more relevant than actual unload-to-onload response time. Definition of "user onload" is undefined or varies from one web page to the next.
  • User needs to download all components Coming for the first time Force refresh of the site Browser automagically cleared the cache based on settings
  • User needs to download all components Coming for the first time Force refresh of the site Browser automagically cleared the cache based on settings
  • Yahoo ran the experiment. Ran against an empty page
  • Older IE: 6 overall, 2 per host Older FF had 24 as overall and 8 per host Newer FF: 30 overall, 15 per host
  • Many host names = more DNS lookups, adds delay Consider the effects of CPU thrashing for the client Lookup times vary across ISPs and geographic locations
  • dynamically combine and cache Combine and minimize before a release
  • Don't use HTMTL attributes to scale Favicon – keep it around, keep it small
  • Hash like tag to compare browser cache against the server version Only download if hash has changed Gives more flexibility than last-modified date Great on a single server setup
  • Typically unique to a server Default behavior in Apache and IIS If hash don't match between server, then browser cache is not used Proper Expires Headers won't help Remove ETags if not being used to its fullest

Caching for Cash, part 4 DPC 2009 Presentation Transcript

  • 1. Caching For Cash Dutch PHP Conference – Amsterdam, June 2009
  • 2.  
  • 3.  
  • 4.  
  • 5.  
  • 6.  
  • 7. 80% of response time is spent downloading content
  • 8.  
  • 9.  
  • 10. “ It all depends on how we look at things, and not how they are in themselves.” - Carl G. Jung
  • 11.  
  • 12.  
  • 13. Key factor in performance Fewer HTTP Requests Easy to improve on
  • 14. Sent with static content Slow upstream speed Big cookies
  • 15. Cookie Size Response Time (Delta) 0 bytes 78 ms ( 0 ms ) 500 bytes 79 ms ( +1 ms ) 1000 bytes 94 ms ( +16 ms ) 1500 bytes 109 ms ( +31 ms ) 2000 bytes 125 ms ( +47 ms ) 2500 bytes 141 ms ( +63 ms ) 3000 bytes 156 ms ( +78 ms ) Times are for page loads on DSL (~800 kbps).
  • 16. Eliminate unnecessary cookies Keep sizes low Appropriate domain levels Set Expires date appropriately
  • 17. Be aware of max connection limits in browsers CNAME to point multiple sub domains to the same IP
  • 18. One domain = 2 Parallel connections
  • 19. Two domains = 4 Parallel connections
  • 20. Too many hostnames can cause complications 2 – 4 sub domains is a good average
  • 21. Combining 6 scripts into 1 eliminates 5 requests Challenges:
      • develop as separate modules
      • 22. combinations vs. loading more than needed
  • 23. JS does not comply with the parallel downloading rule
  • 24. script defer attribute is not a solution
      • blocks rendering and downloads in FF
      • 25. slight blocking in IE
    Solution: move them as low in the page as possible
  • 26. Crushes the files Strips out all cruft Voodoo magic
  • 27. JSMin Dojo Shrinksafe Packer YUI Compressor http://short.ie/compression-rates
  • 28. You can affect users download times
  • 29.
      Gzip can be used on
      • JS
      • 30. CSS
      • 31. XML
      • 32. JSON
  • 33.
      Gzip should not be used on
      • Images
      • 34. PDFs
      • 35. Compressed data formats
  • 36. robots.txt favicon
  • 37. CSS Sprites
  • 38. Badly optimized Thumbnails PNG can be compacted 50%, no quality loss OptiPNG
  • 39. Test on slow connections Slow proxies for developers
  • 40. Data served through a single domain Smart routing software Data closer to the end user – Less latency
  • 41. Amazon CloudFront
  • 42. Appropriate dates Cache far in the future Change file names on releases
  • 43. Hash tag to compare between browser and server Gives more flexibility than last-modified-date Great on a single server setup
  • 44. Typically unique to a server Disable if not being used!
  • 45. Use options that are not unique per server
  • 46. Firebug Firecookie Yslow Page Speed Hammerhead http://stevesouders.com/hammerhead/ http://code.google.com/speed/page-speed
  • 47. “ Knowledge rests not upon truth alone, but upon error also.” - Carl G. Jung