## Lyracons TechTalk on Varnish & Magento ##
- Speakers: Gustavo G. Moyano and Ezequiel Kupelian
- Scope:
Understanding what Varnish is (and isn't), how we can use it with Magento shops, best practices and ways to further optimize it
10. What is a proxy?
“In computer networks, a proxy server is a server (a
computer system or an application) that acts as an
intermediary for requests from clients seeking
resources from other servers…”
Wikipedia: Proxy server
16. Varnish-Cache Features: Part 1
• Designed for content-heavy dynamic web sites
• Heavily threaded, with each client connection being handled by a separate worker thread
• Varnish Configuration Language (VCL)
• Load balancing and backend health polling
17. Varnish-Cache Features: Part 2
• Support for Edge Side Includes
• Graceful handling of dead and slow backends
• The web management administration interface
• The management port
• Live statistics and logging
21. Does Magento support Varnish?
WHY ?
• Dynamic content/Personalization
• Painstaking customization of VCL
• No tagging/Partial flushing
• Session Cookie
NO
22. Diluting Varnish with Turpentine
• Full Page Caching, with hole-punching via Varnish ESI and/or AJAX
• Configurable via standard Magento methods
• Able to generate and apply new Varnish VCLs on the fly
• Blacklist requests from caching by URL or parameters (SID, store, etc)
• Configure cache TTL by URL and individual block's TTL
• Supports multiple Varnish instances for clustered usage
• Automatic cache clearing on Magento actions
• Supports non-root Magento installs and multi-store/multi-site setups
• Support for site-crawlers for cache warming
26. Lessons learned
Triple check
• Dynamic blocks in the project
MiniCart
Login
Anything customer related
• Currency & Store View switcher
• 3rd Party modules in Admin !
• Checkout
• Payment gateways redirects
• Customer groups
• Design Exceptions
27. Further optimizations
The fastest HTTP request is the one not made
– Use cookie or local storage (IE>7) when:
- Adds a product to a cart
- Logs in or logs out
- Adds a product to a compare list
- Recently viewed products, etc
Increase Hit Ratio
– Cache 404 pages
– Redirects
KEEP PUSHING
29. Thank You !
Gustavo G. Moyano
DevOps Engineer
Ezequiel A. Kupelian
Dev. Manager
Notas del editor
a http accelerator
a load balancer
a failover system and
a caching reverse proxy
a http accelerator
a load balancer
a failover system and
a caching reverse proxy
a http accelerator
a load balancer
a failover system and
a caching reverse proxy
a http accelerator
a load balancer
a failover system and
a caching reverse proxy
You can decrease amount of AJAX calls to the number of real user actions.
– Customer adds product to cart, you make an ajax call to update session storage
– Customer logs in, you make and ajax call to update the it again
– Customer adds product to wishlist or compare products list, you update a session storage.
So in the end it should be 1 action – 1 AJAX call, and NOT 1 page view – 3 or more AJAX calls!
The higher the ratio, the more effective the cache is at improving performance. Less operations in Magento and MySQL will mean reduced server footprint, which lower costs, and faster responses, which increase convertion => more sales.