Getting Started with Varnish Cache: Accelerate Your Web Applications by Thijs Feryn

Getting Started with Varnish Cache: Accelerate Your Web Applications by Thijs Feryn

Author:Thijs Feryn [Feryn, Thijs]
Language: eng
Format: azw3
Publisher: O'Reilly Media
Published: 2017-03-13T04:00:00+00:00


Proper cache invalidation requires a lot of insight into the application and the way HTTP is used. If you’re using frameworks like Wordpress, Drupal, or Magento, you’ll find third-party modules that handle the invalidation for you.

A final piece of advice I can give you regarding cache invalidation is the use of surrogate keys. Instead of purging URLs or URL patterns, you can use surrogate keys to register tags under the form of an HTTP response header called xkey; it’s just a matter of invalidating pages by tag instead of URL.

To perform tag-based invalidation, you can use the vmod_xkey that is part of the Varnish modules package. I won’t cover surrogate keys in detail because it’s beyond the scope of this book. Have a look at the page, install the modules package, and go ahead and try it yourself. This can be very useful when lots of related invalidations need to happen. Invalidating by tag seems like a nice approach.

Let’s cover yet another approach: remember “Conditional Requests”? If your backend is highly optimized for these conditional requests, there is no need to purge or ban. Conditional requests will automatically update the cache if the backend data has changed and will return an HTTP 304 as long as the data remains unmodified.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.