Caching
Welcome to the Caching section of my blog, where I share insights and expertise on using Varnish and Fastly. Here, you will find articles that detail my experiences in learning, setting up, configuring Fastly products.
We’re exploring the Error, Restart, and Log subroutines, but a heads-up: Restart isn’t technically a subroutine in the usual sense. For our learning objectives, let’s focus on understanding these elements: Where they fit into the overall process What they’re supposed to do Ho...
How to install Terraform On a Mac : brew install hashicorp/tap/terraform Verify Terraform is set up : terraform -help Create a the main terraform file Let’s create our terraform project in his own folder : mkdir terraform-tutorial && cd terraform-tutorial Then let’s create our ma...
Create the docker container docker run --name varnish -p 3456:80 varnish This command runs a Docker container named « varnish » using the « varnish » image. It maps port 3456 on the host to port 80 in the container, allowing access to the containerized varnish service. Start the container do...
VCL_hash From this diagram we can see vcl_hash runs after receive and there is no way to avoid it. Indeed, just after hash the hash table look up takes place. As a reminder each node has a hash table. This hash table tracks what’s in cache on that specific node. Each request that comes through...
Varnish state machine flow When a request comes into Fastly, it’s assigned out from a load balancer to one of the nodes on the POP, and that will act as the delivery node. Then there is a domain lookup where the request host header, the value there, say example.com is looked up on a giant [&he...
VCL states : This article zooms into the steps of dealing with requests using Varnish, shown in a diagram. We’ll mainly look at three important parts: RECV, FETCH, and DELIVER. RECV, FETCH, and DELIVER. RECV : We refer it as a request type, used when we receive the request. In this condition w...
Without shielding To understand shielding, let’s look at this diagram. My main server is in Roubaix, France. My aim is to lighten the load on this server as much as possible. Requests come from all over the world, handled by the nearest Fastly POPs. However, these POPs still need to reach my s...
The clustering nodes In a Point of Presence (PoP), there are several nodes that work independently. Each node has its own hash table to keep track of cached objects. When a user sends a request, if the node handling the request doesn’t have the requested object in its hash table, the request m...
What’s request collapsing ? Concept of request collapsing in the context of a cache system refers to the scenario where multiple identical requests for the same data are received by the cache system simultaneously or within a short period of time. Instead of processing each request separately,...
Why purging ? If you want to make sure everyone sees the latest version of something on a website, like a new headline, you might need to « purge » or clear out the old version from the cache. It’s like refreshing a page to see the newest updates. So, if you change the headline on a [&hell...
What’s caching ? In a web application, caching works like a high-speed memory that stores frequently accessed data or content. When a user requests information from the application, instead of fetching it from the original source every time, the application checks if it’s already stored ...