Your SlideShare is downloading. ×
Varnish & Magento
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Varnish & Magento


Published on

Deze presentatie werd gegeven op de Magento User Group over Magento Caching (16 april 2013).

Deze presentatie werd gegeven op de Magento User Group over Magento Caching (16 april 2013).

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Caching MagentoUsing Varnish to speed up Magento Maarten van Schaik - 16-4-2012
  • 2. Who am I• Maarten van Schaik• Software developer at Byte Internet• Creates tools for hosting Magento shops
  • 3. The issue• Magento is very extensive and complex• There are a lot of extensions of varying quality• This can cause shops to become too slow• Which impacts turnover
  • 4. Possible solutions• Better hardware• Reduce number of extensions• Dont use Magento! :-)
  • 5. Normal request GET /katten/kattenvoer 200 <html> ...• User makes request• Magento renders response• Response time: 0.5 - 3 seconds
  • 6. Request through Varnish GET /katten/kattenvoer GET /katten/kattenvoer 200 <html> ... 200 <html> ...• User makes request• Varnish passes request to Magento• Varnish saves response in memory• And serves it to the user
  • 7. Next time: Varnish cache hit GET /katten/kattenvoer 200 <html> ...• Varnish has response in memory so can immediately serve it to the user• Response time: <100 ms
  • 8. Uncacheable pages GET /cart/checkout GET /cart/checkout Cache-control: no-cache 200 <html> ... 200 <html> ...• Magento instructs Varnish to exclude certain URLs from the cache
  • 9. Personalized pages POST /account/Loginpost POST /account/Loginpost Set-Cookie: LOGGED_IN 200 <html> ... Set-Cookie: LOGGED_IN 200 <html> ...• Once a user logs in it gets a cookie that indicates to Varnish that requests have become uncacheable
  • 10. User views personalized pages Cookie: LOGGED_IN GET /katten/kattenvoer Cookie: LOGGED_IN GET /katten/kattenvoer 200 <html> ... 200 <html> ...• As long as user has special cookie (logged in, stuff in basket), Varnish will not cache• Response time back to 0.5 - 3 seconds
  • 11. Changing or removing catalog GET /admin/delete/id/324 GET /admin/delete/id/324 Purge /katten/kattenvoer Purge /katten .... 200 <html> ... 200 <html> ...• Magento tells Varnish to purge changed pages
  • 12. So, what do I need?• Avoid extensions that offer personalization• Extension for Magento with matching Varnish configuration file
  • 13. Is Varnish caching for you?• Not all shops are fit for full-page caching• Will probably not work out of the box, so knowledge on inner workings of Magento might be needed• Balance between personalized shopping experience and caching• Probably mostly useful for (very) large-scale sites with high concurrency