Web Caching Workshop - mod_cache, Varnish, Amazon CloudFront CDN & S3


Published on

"Add Expires Headers", "Use of a Content Delivery Network (CDN)", "Leverage browser caching", "Leverage proxy caching", ...
Did the Yahoo YSlow! plugin or the Google Chrome Developer Tools flash with some caching & CDN warnings?

Or even worse, does your web site collapse often or your data center's internet connection sometimes saturate from constantly serving static files?

Discover through this workshop how to use on your project the caching techniques of the big players of the Internet.

* Headers Http 'Expires' and 'Cache-Control'
** The theory: RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 - Header Field Definitions - Cache-Control
** "cacheable content" versus "static content" : offer a new scalability to your web site,
** How to add caching headers with your web framework,
** ExpiresFilter: how to add caching headers to the static content of a java webapp,

* Apache Httpd mod_expires and NGinx HttpHeadersModule : global filters on web servers,

* Apache Httpd mod_cache and NGinx proxy_cache : the "quick wins" to add a caching proxy to your infrastructure,

* Varnish, the star of the caching proxies,

* Amazon CloudFront : the Content Delivery Network (CDN) made by Amazon AWS. It's simple, it's cheap and it works,

* Amazon S3, the other way to serve static content.

Bonus: deploy your webapp on Amazon Beanstalk, the Tomcat as a Service made by Amazon AWS.

The lab:

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Web Caching Workshop - mod_cache, Varnish, Amazon CloudFront CDN & S3

  1. 1. Web Caching Workshop mod_cache, Varnish, Amazon CloudFront CDN & S3 Julia Mateo Charles Blonde Cyrille Le Clerc Seven Le Mesle Stéphane MoreauWednesday, August 1, 12
  2. 2. L’équipe§ Julia Mateo @juliamateo82§ Charles Blonde @blondecharles§ Cyrille Le Clerc @cyrilleleclerc§ Seven Le Mesle @slemesle§ Stéphane Moreau @stfmoreau 2Wednesday, August 1, 12
  3. 3. Cocktail 3Wednesday, August 1, 12
  4. 4. Initial Architecture cocktail Internet Tomcat YSlow http://xfr-cocktail-xxx.elasticbeanstalk.com/ Initial Architecture 4Wednesday, August 1, 12
  5. 5. Amazon S3 as a media database cocktail Tomcat Internet http://xfr-cocktail-xxx.elasticbeanstalk.com/ YSlow http://cocktail.s3-website-us-east-1.amazonaws.com/ S3 Simple Storage Service Amazon S3 as a media database 5Wednesday, August 1, 12
  6. 6. Javascript and CSS libs’ CDN cocktail Internet Tomcat http://xfr-cocktail-xxx.elasticbeanstalk.com/ YSlow Bootstrap http://ajax.googleapis.com/ Javascript & CSS libs CDN 6Wednesday, August 1, 12
  7. 7. Expires Headers Expires: ... Cache-Control: max-age ... Internet cocktail YSlow Tomcat http://xfr-cocktail-xxx.elasticbeanstalk.com/ Expires Headers with a Filter 7Wednesday, August 1, 12
  8. 8. Apache Httpd as a Caching Proxy mod_cache cocktail Internet Apache Tomcat YSlow http://www-cocktail-xxx.aws.xebiatechevent.info/ Apache Httpd as a caching proxy 8Wednesday, August 1, 12
  9. 9. Varnish Caching Proxy cocktail Internet Varnish Tomcat YSlow http://www-cocktail-xxx.aws.xebiatechevent.info:6081/ Varnish caching proxy 9Wednesday, August 1, 12
  10. 10. Amazon Cloud Front CDN cocktail Internet YSlow Tomcat Cloud Front http://xfr-cocktail-xxx.elasticbeanstalk.com/ http://d1mm4v4zybjqbh.cloudfront.net/ Amazon Cloud Front CDN 10Wednesday, August 1, 12
  11. 11. “Ideal” Architecture http://www-cocktail-xxx.aws.xebiatechevent.info:6081/ Varnish cocktail Tomcat Cloud Front http://xyz12.cloudfront.net/ Bootstrap http://cocktail.s3-website-us-east-1.amazonaws.com/ http://ajax.googleapis.com/ S3 Simple Storage Service "Ideal" Architecture Amazon Cloud Front CDN + Varnish Caching Proxy + Google CDN & Bootstrap CDN + Amazon S3 as a "media database" 11Wednesday, August 1, 12
  12. 12. You have learned§ Add expiration headers to a Java web application§ Use Bootstrap CDN and Google CDN§ Use a web server auch as Apache Httpd as a Caching Proxy§ Use a Caching Proxy such as Varnish Cache§ Use a Content Delivery Network such as Amazon CloudFront§ Integrate CDN based URLs in a web application 12Wednesday, August 1, 12
  13. 13. Your turn! https://github.com/xebia-france/workshop-web-caching-cocktail/wiki/ 13Wednesday, August 1, 12
  14. 14. One more thing 14Wednesday, August 1, 12
  15. 15. Le billet de blog 15Wednesday, August 1, 12
  16. 16. Les 10 commandements du cache http://blog.xebia.fr/2012/07/10/les-10-commandements-du-cache/ 16Wednesday, August 1, 12