This document provides an introduction to Varnish Configuration Language (VCL) which defines Varnish's policy for handling HTTP requests. It discusses key VCL concepts like different request states, built-in functions, objects, and the various VCL subroutines used to define logic for different phases of a request lifecycle like vcl_recv, vcl_hash, vcl_miss etc. It also covers topics like defining backends, directors, ACLs, using VMODs and banning cached content.
Using advanced options in MariaDB Connector/JMariaDB plc
MariaDB Connector/J is our widely used Type 4 JDBC driver for Java. This session covers the basics of getting started with Java and MariaDB, and moves quickly to more advanced topics, including connection pooling, automatic failover and debugging. Diego Dupin also includes an overview of popular object/relational mapping (ORM) and programming frameworks for Java. Even if you have been using the MariaDB Connector/J for years, come to this session to learn about the latest release, see where the connector is going and discover the latest tips and tricks.
Building better Node.js applications on MariaDBMariaDB plc
In this session, Diego Dupin teaches tips and tricks for using the new Node.js connector for MariaDB. Recent driver updates include exciting new features such as a promise-based API, pipelining and insert streaming. Targeted at beginner to intermediate Node.js developers, this session includes basics for getting started with Node.js before focusing on best practices and more advanced topics. The session finishes with an overview of integration with well-known Node.js frameworks, including the popular objection/relational mapping (ORM) frameworks.
Andrew Betts Web Developer, The Financial Times at Fastly Altitude 2016
Running custom code at the Edge using a standard language is one of the biggest advantages of working with Fastly’s CDN. Andrew gives you a tour of all the problems the Financial Times and Nikkei solve in VCL and how their solutions work.
Using advanced options in MariaDB Connector/JMariaDB plc
MariaDB Connector/J is our widely used Type 4 JDBC driver for Java. This session covers the basics of getting started with Java and MariaDB, and moves quickly to more advanced topics, including connection pooling, automatic failover and debugging. Diego Dupin also includes an overview of popular object/relational mapping (ORM) and programming frameworks for Java. Even if you have been using the MariaDB Connector/J for years, come to this session to learn about the latest release, see where the connector is going and discover the latest tips and tricks.
Building better Node.js applications on MariaDBMariaDB plc
In this session, Diego Dupin teaches tips and tricks for using the new Node.js connector for MariaDB. Recent driver updates include exciting new features such as a promise-based API, pipelining and insert streaming. Targeted at beginner to intermediate Node.js developers, this session includes basics for getting started with Node.js before focusing on best practices and more advanced topics. The session finishes with an overview of integration with well-known Node.js frameworks, including the popular objection/relational mapping (ORM) frameworks.
Andrew Betts Web Developer, The Financial Times at Fastly Altitude 2016
Running custom code at the Edge using a standard language is one of the biggest advantages of working with Fastly’s CDN. Andrew gives you a tour of all the problems the Financial Times and Nikkei solve in VCL and how their solutions work.
With the Varnish caching proxy you can make websites blazingly fast. The basics are quite simple once you understand how cache handling in HTTP works. For starters, we will look into HTTP and Varnish configuration. The main course is going to be test-driven cache invalidation and the cache tagging strategy. For desserts, there will be an introduction to Edge Side Includes (ESI). All of this will be liberally sprinkled with examples from the FOSHttpCache library and some ideas from the FOSHttpCacheBundle for Symfony2.
EWD 3 Training Course Part 34: QEWD Resilient ModeRob Tweed
This is part 34 of the EWD 3 Training Course. This presentation explains how you can add resilience to the message queue used by QEWD by making it save all incoming requests to your embedded Global Storage database. In Resilient Mode, QEWD also saves a copy of all responses sent to clients, so the stored activity information can be used as an audit trail.
Next Generation DevOps in Drupal: DrupalCamp London 2014Barney Hanlon
In this talk, Barney will be discussing and demonstrating how to:
- Use nginx, Varnish and Apache together in a "SPDY sandwich" to support HTTP 2.0
- Setting up SSL properly to mitigate against attack vectors
- Performance improvements with mod_pagespeed and nginx
- Deploying Drupal sites with Docker containers
Barney is a Technical Team Leader at Inviqa, a Drupal Association member and writes for Techportal on using technologies to improve website performance. He first started using PHP professionally in 2003, and has over seventeen years experience in software development. He is an advocate of Scrum methodology and has an interest in performance optimization, researching and speaking on various techniques to improve user experience through faster load times.
This is the presentation delivered by Karthik.P.R at MySQL User Camp Bangalore on 09th June 2017. ProxySQL is a high performance MySQL Load Balancer Designed to scale database servers.
Presentation shows how ProxySQL can improve the HA in solution like MySQL async and sync replication without the need to increase the platform complexity.
Advance Sharding Solution with ProxySQL
ProxySQL is a very powerful platform that allows us to manipulate and manage our connections and queries in a simple but effective way.
Historically MySQL lacks in sharding capability. This significant missing part had often cause developer do implement sharding at application level, or DBA/SA to move on to another solution.
ProxySQL comes with an elegant and simple solution that allow us to implement sharding capability with MySQL without the need to perform significant, or at all, changes in the code.
This brief presentation will illustrate how to successfully configure and use ProxySQL to perform sharding, from very simple approach based on connection user/ip/port, to complicate ones that see the need to read values inside queries.
.NET developers have a lot of options when it comes to databases these days. Apache Cassandra is a scalable, fault-tolerant database that has already found its way into more than 25% of the Fortune 100 and continues to grow in popularity. But what makes it different from the myriad of other options available? In this talk, we’ll take a deep dive into Cassandra and learn about:
- Cassandra’s internals and how it works
- CQL (the SQL-like query language for Cassandra)
- Data Modeling like a pro
- Tools available for developers
- Writing .NET code that talks to Cassandra
If there’s time and interest, we’ll finish up with how some companies are already using Cassandra to power services you probably interact with in your daily life. You’ll leave with all the tools you need to start build highly available .NET applications and services on top of Cassandra.
MySQL and MariaDB though they share the same roots for replication .They support parallel replication , but they diverge the way the parallel replication is implemented.
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...Severalnines
Proxies are building blocks of HA setups for MySQL & MariaDB. They can detect failed nodes and route queries to hosts which are still available. If your master failed and you had to promote one of your slaves, proxies will detect such topology changes and route your traffic accordingly. More advanced proxies can do much more: route traffic based on precise query rules, cache queries or mirror them. They can be even used to implement different types of sharding.
Introducing ProxySQL!
In this joint webinar with ProxySQL’s creator, René Cannaò, we discuss this new proxy and its key features. We show you how you can deploy ProxySQL using ClusterControl. And we give you an early walk-through of some of the exciting ClusterControl features for ProxySQL that we have planned for its next release.
AGENDA
1. Introduction
2. ProxySQL concepts (René Cannaò)
- Hostgroups
- Query rules
- Connection multiplexing
- Configuration management
3. Demo of ProxySQL setup in ClusterControl (Krzysztof Książek)
4. Upcoming ClusterControl features for ProxySQL
SPEAKERS
René Cannaò, Creator & Founder, ProxySQL. René has 10 years of working experience as a System, Network and Database Administrator mainly on Linux/Unix platform. In the last 4-5 years his experience was focused mainly on MySQL, working as Senior MySQL Support Engineer at Sun/Oracle and then as Senior Operational DBA at Blackbird, (formerly PalominoDB). In this period he built an analytic and problem solving mindset and he is always eager to take on new challenges, especially if they are related to high performance. And then he created ProxySQL…
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Presentation Video: http://youtu.be/hZQc335WIvc
Goals:
Thorough understanding of Varnish.
Understanding of how VCL works and how to use it.
Know how varnish works with Drupal and Wordpress.
Debug using varnish tools.
With the Varnish caching proxy you can make websites blazingly fast. The basics are quite simple once you understand how cache handling in HTTP works. For starters, we will look into HTTP and Varnish configuration. The main course is going to be test-driven cache invalidation and the cache tagging strategy. For desserts, there will be an introduction to Edge Side Includes (ESI). All of this will be liberally sprinkled with examples from the FOSHttpCache library and some ideas from the FOSHttpCacheBundle for Symfony2.
EWD 3 Training Course Part 34: QEWD Resilient ModeRob Tweed
This is part 34 of the EWD 3 Training Course. This presentation explains how you can add resilience to the message queue used by QEWD by making it save all incoming requests to your embedded Global Storage database. In Resilient Mode, QEWD also saves a copy of all responses sent to clients, so the stored activity information can be used as an audit trail.
Next Generation DevOps in Drupal: DrupalCamp London 2014Barney Hanlon
In this talk, Barney will be discussing and demonstrating how to:
- Use nginx, Varnish and Apache together in a "SPDY sandwich" to support HTTP 2.0
- Setting up SSL properly to mitigate against attack vectors
- Performance improvements with mod_pagespeed and nginx
- Deploying Drupal sites with Docker containers
Barney is a Technical Team Leader at Inviqa, a Drupal Association member and writes for Techportal on using technologies to improve website performance. He first started using PHP professionally in 2003, and has over seventeen years experience in software development. He is an advocate of Scrum methodology and has an interest in performance optimization, researching and speaking on various techniques to improve user experience through faster load times.
This is the presentation delivered by Karthik.P.R at MySQL User Camp Bangalore on 09th June 2017. ProxySQL is a high performance MySQL Load Balancer Designed to scale database servers.
Presentation shows how ProxySQL can improve the HA in solution like MySQL async and sync replication without the need to increase the platform complexity.
Advance Sharding Solution with ProxySQL
ProxySQL is a very powerful platform that allows us to manipulate and manage our connections and queries in a simple but effective way.
Historically MySQL lacks in sharding capability. This significant missing part had often cause developer do implement sharding at application level, or DBA/SA to move on to another solution.
ProxySQL comes with an elegant and simple solution that allow us to implement sharding capability with MySQL without the need to perform significant, or at all, changes in the code.
This brief presentation will illustrate how to successfully configure and use ProxySQL to perform sharding, from very simple approach based on connection user/ip/port, to complicate ones that see the need to read values inside queries.
.NET developers have a lot of options when it comes to databases these days. Apache Cassandra is a scalable, fault-tolerant database that has already found its way into more than 25% of the Fortune 100 and continues to grow in popularity. But what makes it different from the myriad of other options available? In this talk, we’ll take a deep dive into Cassandra and learn about:
- Cassandra’s internals and how it works
- CQL (the SQL-like query language for Cassandra)
- Data Modeling like a pro
- Tools available for developers
- Writing .NET code that talks to Cassandra
If there’s time and interest, we’ll finish up with how some companies are already using Cassandra to power services you probably interact with in your daily life. You’ll leave with all the tools you need to start build highly available .NET applications and services on top of Cassandra.
MySQL and MariaDB though they share the same roots for replication .They support parallel replication , but they diverge the way the parallel replication is implemented.
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...Severalnines
Proxies are building blocks of HA setups for MySQL & MariaDB. They can detect failed nodes and route queries to hosts which are still available. If your master failed and you had to promote one of your slaves, proxies will detect such topology changes and route your traffic accordingly. More advanced proxies can do much more: route traffic based on precise query rules, cache queries or mirror them. They can be even used to implement different types of sharding.
Introducing ProxySQL!
In this joint webinar with ProxySQL’s creator, René Cannaò, we discuss this new proxy and its key features. We show you how you can deploy ProxySQL using ClusterControl. And we give you an early walk-through of some of the exciting ClusterControl features for ProxySQL that we have planned for its next release.
AGENDA
1. Introduction
2. ProxySQL concepts (René Cannaò)
- Hostgroups
- Query rules
- Connection multiplexing
- Configuration management
3. Demo of ProxySQL setup in ClusterControl (Krzysztof Książek)
4. Upcoming ClusterControl features for ProxySQL
SPEAKERS
René Cannaò, Creator & Founder, ProxySQL. René has 10 years of working experience as a System, Network and Database Administrator mainly on Linux/Unix platform. In the last 4-5 years his experience was focused mainly on MySQL, working as Senior MySQL Support Engineer at Sun/Oracle and then as Senior Operational DBA at Blackbird, (formerly PalominoDB). In this period he built an analytic and problem solving mindset and he is always eager to take on new challenges, especially if they are related to high performance. And then he created ProxySQL…
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Presentation Video: http://youtu.be/hZQc335WIvc
Goals:
Thorough understanding of Varnish.
Understanding of how VCL works and how to use it.
Know how varnish works with Drupal and Wordpress.
Debug using varnish tools.
In-depth caching in Varnish - GOG Varnish Meetup, march 2019GOG.com dev team
You think Varnish can cache responses by URL only? Not even close. Learn all different caching strategies available in Varnish, their benefits and consequences of usage. Learn how to and when to queue requests for the same endpoint, how to handle requests with conditional caching headers and how to have two levels of cache by tagging the responses.
You have amazing content and you want to get it to your users as fast as possible. In today’s industry, milliseconds matter and slow websites will never keep up. You can use a CDN but they are expensive, make you dependent on a third party to deliver your content, and can be notoriously inflexible. Enter Varnish, a powerful, open-source caching reverse proxy that lives in your network and lets you take control of how your content is managed and delivered. We’ll discuss how to install and configure Varnish in front of a typical web application, how to handle sessions and security, and how you can customize Varnish to your unique needs. This session will teach you how Varnish can help you give your users a better experience while saving your company and clients money at the same time.
Isha Training Solutions Presents "Performance Testing Using Web Services" course.
For Course content and other information, pls follow below link
http://ishatrainingsolutions.org/performance-testing-of-webservices-using-loadrunner-recorded-videos/
Live project support is provided on any performance testing tools and also any protocols under the roof -- Call me or Whatsapp me on +91-8019952427
Other Courses Offered by ISHA
Course 1) Performance Testing Using Jmeter
http://ishatrainingsolutions.org/performance-testing-using-apache-jmeter/
Course 2) Web Services Performance Testing using LoadRunner
http://ishatrainingsolutions.org/performance-testing-of-webservices-using-loadrunner-recorded-videos/
Course 3) SAPGUI protocol - Performance Testing for SAP applications Using LoadRunner
http://ishatrainingsolutions.org/performance-testing-using-loadrunner-for-sapgui-applications-using-sapgui-protocol/
How to implements the infra-structure for micro services? In this session, we'll compare building it with Spring Cloud vs. using Docker swarm/Kubernetes support.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
3. Varnish Resources
✤ Varnish Cache Website
http://www.varnish-cache.org/
✤ The Varnish Book
https://www.varnish-software.com/static/book/
Designed as a classroom-led official training manual. It’s written like
a schoolbook, but it’s good and up-to-date in a way that a lot of
Varnish documentation out there isn’t.
5. Where We Left Off
✤ At the last meetup I introduced Varnish, explained its architecture
and how to install it and monitor it successfully.
✤ Tonight we’ll dive into Varnish Configuration Language and discuss
how VCL defines Varnish’s policy for handling HTTP requests.
✤ I’ll be discussing Varnish 3.0 specific syntax, anyone using 2.1.5 or
earlier should be aware that VCL has changed syntax somewhat
between v2 and v3.
7. Hits & Misses, Passes & Pipes
✤ A hit happens when a request comes in and the hash matches a
response in the cache. The response is sent to the client and the
backend never knows about it.
✤ A miss happens when a request is not present in the cache or is
present but expired or banned. The request is sent to the backend and
its response is saved in the cache.
✤ A pass happens when varnish is configured to bypass certain
requests. They are never cached and don’t figure in hit rates.
✤ A pipe grants a direct passthrough to the backend. Used for media
streams.
8. What Is VCL?
✤ A domain-specific language
used to define the way Varnish
handles & caches HTTP requests
✤ Has if statements & regexes
but no user functions or loops
✤ C-like syntax
✤ Compiled to C by the server
and linked dynamically
9. The VCL Engine
✤ VCL defines how each HTTP request is processed. Each request is
processed independently.
✤ Varnish parses and verifies requests but all policy decisions about
how requests are cached and routed depends on VCL code.
✤ Each predefined VCL function handles a particular phase of the
request lifecycle, and ends with a return() statement that forwards the
workflow to the next phase.
10. Built-In Functions & Keywords
✤ VCL includes some built-in functions to be used during request
processing.
✤ regsub() and regsuball() allow a user to modify headers based on regex
matching. There are some simpler methods using VMODs but it’s
good to be comfortable writing complex regexes when implementing
complicated logic in VCL.
✤ The set keyword is used to set headers on a request or response, and
the remove or unset keywords can remove them. Setting headers is the
only way to pass information between VCL subroutines.
✤ The ban() function allows you to remove entries from the cache.
11. Writing VCL
✤ Each VCL function has a default that will always run unless you
override it. The default is appended to the end of any VCL function
you include.
✤ If you include the same VCL function twice they’re appended in the
order read.
✤ It’s possible to include other files using the
include statement. Statements can be defined
as subroutines for convenience and
readability and executed later with the
call statement.
12. Return Values in VCL
✤ Every VCL function has a set of possible return values that determine
a request’s handling. error and restart are available in most functions.
✤ return(error) passes control to vcl_error().
✤ return(restart) increments the restart counter and begins again at
vcl_recv().
✤ The default VCL code will run for a function if the user code does not
return().
13.
14. Data Objects in VCL
✤ VCL exposes global objects representing HTTP requests or responses
that can be read and modified. Different objects are available in
different VCL functions, e.g. beresp cannot be modified in vcl_recv
because we don’t have a backend response yet.
✤ The five main objects are the request object (req), response object
(resp), the backend request and response objects (bereq and beresp), and
the cache object (obj).
✤ client and server are read-only objects that expose data about the client
and the varnish server itself respectively.
15. Defining Backends & Probes
✤ Varnish forwards uncached
requests to defined backends
✤ Probes ensure a backend is healthy
✤ To be considered healthy, backend
must pass threshold probes out of
the last window attempts.
16. Directors
✤ Directors are collections of
backends
✤ They define which backends are
chosen for a request
✤ Director types include random,
client, hash, round-robin, DNS,
and fallback.
17. Access Control Lists
✤ ACLs consist of lists of IP addresses
✤ ACLs can be matched against in VCL code to restrict access
18. Receiving Requests with vcl_recv
✤ vcl_recv happens to every request.
✤ Use it to check and add headers, perform bans and redirects,
forward to proxies, and manage cookies.
✤ The req object is available
here.
✤ Possible return values are
pass, lookup, pipe, and error.
19. Default vcl_recv
✤ The vcl_recv default is important
to understand in order to get
good cache hit ratios.
✤ It won’t cache in the presence of
cookies or authorization headers.
✤ You’ll generally need to use your
own vcl_recv to strip cookies you
don’t care about to have any
caching at all.
20. Proper Passing via vcl_pass
✤ vcl_pass happens when a request is passed in vcl_recv, vcl_hit, or
vcl_miss.
✤ A return(pass) in vcl_pass sends control to vcl_fetch.
✤ The default content is to simply return(pass).
✤ The req and the bereq objects are available.
✤ Possible return values are pass, restart, and error.
21. Heavenly Hashes with vcl_hash
✤ vcl_hash happens to any request calling return(lookup) in vcl_recv.
✤ Use it to add values to the hash. Any aspects of the request that
affect the returned content should be
included in the hash by calling hash_data().
✤ The req object is available.
✤ The only possible return value is hash.
22. Default vcl_hash
✤ The vcl_hash default includes the
URL and the host or IP address.
✤ Anything that changes the HTML
returned from the backend needs
to be hashed on. Device types,
login cookies, referers; depending
on your application.
✤ It’s a good idea to strip any utm_source or other tracking query string
elements to prevent unnecessarily fragmenting your cache.
23. Handling Hits in vcl_hit
✤ vcl_hit is executed when a hashed request is found in the cache.
✤ A return(pass) in vcl_hit sends control to
vcl_pass.
✤ The default content is to simply
return(deliver), which sends control to
vcl_deliver().
✤ req and obj are exposed to vcl_hit.
✤ Possible return values are deliver, pass,
restart, and error.
24. Manipulating Misses with vcl_miss
✤ vcl_miss is executed when a hashed request is not found in the
cache.
✤ A return(pass) in vcl_miss sends control
to vcl_pass.
✤ The default content is return(fetch),
which sends control to vcl_fetch().
✤ req and bereq are exposed to vcl_miss.
✤ Possible return values are fetch, pass,
restart, and error.
25. Fantastic Fetching in vcl_fetch
✤ vcl_fetch is executed after a backend request is made but before that
response is stored in the cache. It happens either after vcl_miss
returns fetch or vcl_pass returns pass.
✤ The req, bereq, and beresp objects
are accessible in vcl_fetch.
✤ Possible return values are
deliver, hit_for_pass, restart,
and error.
26. Default vcl_fetch
✤ The vcl_fetch defaults to deliver unless the backend has set a cookie or
a Vary header or the TTL is 0.
✤ hit_for_pass is a special condition that stores an object in the cache but
sets a flag marking it as content that should be fetched fresh from the
backend for as long as the flag exists.
27. Dynamic Delivery in vcl_deliver
✤ vcl_deliver is executed when varnish returns content to the client.
✤ The resp object is accessible,
none of the other request or
response objects are in scope.
✤ The default is to return(deliver).
✤ Possible return values are
deliver, restart, and error.
28. Expectorate Errors using vcl_error
✤ vcl_error is executed when any VCL function returns error.
✤ The default uses the synthetic
keyword to deliver a Guru
Meditation error to the client.
✤ Possible return values are
deliver and restart.
29. Other VCL functions
✤ vcl_pipe is executed when vcl_recv returns pipe. It’s used for
streaming media and tells varnish to pipe that client directly to the
backend for the duration of the HTTP connection. If you use this,
you should explicitly close the connection from the backend when
done piping with a Connection: close header.
✤ vcl_init and vcl_fini are functions that get called upon the loading
and unloading of a VCL script, respectively. They’re used for
initializing and cleaning up VMODs during startup and shutdown.
30. Using VMODs
✤ VMODs are varnish modules. They’re initialized with the import
keyword and they export functions into VCL.
✤ vmod_std is packaged with
Varnish and provides small
useful functions.
✤ Other Varnish modules are available including geoIP lookups, Redis
and Memcache clients, and custom VMODs can be written in C for
use with Varnish.
31. Banning Basics
✤ You can use the built-in VCL ban() function to perform bans of cached
content.
✤ Calling the ban() function adds your expression to the ban list, which
is checked after a cache object is found. If the object matches a ban on
the ban list, its considered a miss rather than a hit.
✤ ban(“req.url ==” + req.url); would ban any content from a URL
matching req.url. Bans can be set to match on any request header, not
just URL.
32. Active Banning
✤ It’s possible to write VCL that can accept ban requests from your
backends. By doing this, it allows a backend to actively ban changed
content from the varnish cache, ensuring clients get the most up to
date version of the content.
✤ This example bans based on
the URL, but it could have
a more complex rule that
matches a header set by the
backend.
33. VCL Takeaways
✤ The Varnish website contains a lot of great examples of handy tricks
you can use in your own VCL code, but it’s important to understand
what you’re doing before you implement them.
✤ Know your HTTP protocol. Varnish is tightly tied to HTTP so it’s very
helpful to understand the HTTP protocol and its intricacies, especially
how basic HTTP caching headers are interpreted by browsers and
other clients.
✤ Keep it simple at first, and iterate improvements. It’s tempting to
write a huge VCL policy that has all the bells and whistles but a
complex VCL can be difficult to debug. Start small and add
complexity as you go.
34. A Closing Testimonial From Jay-Z
✤ “If you’re having scaling problems,
I feel bad for you son...
Clients sent 99 requests
but my backend got one.”
Photo by flickr user matthew_harrison
35. Til Next Time...
✤ Come back next month (date TBD) for another exciting adventure
with Varnish...
Advanced VCL Tricks