Follow

How does Web Cache work?

The WebCache rack node subscribes to all port 80 traffic. Each client request is forwarded to squid-cache running on the local appliance. If the cache has the content stored locally, we transmit the response directly to the client, allowing all the other nodes and services to act on the content as required, and life is grand. That's called a cache hit, and it's really pretty simple.

The real magic kicks in when handling a cache miss. In this case, we can't allow squid to go grab the content and hand it directly to the client like it normally would. We need the response to pass through all of the other apps and services. So we got a little creative with the Squid setup by configuring all external content to come from a peer cache. That peer cache is actually another thread within our WebCache node. When Squid connects back to us for a cache miss, we allow the original request to continue outbound as it normally would, and we intercept the response from the external server. This allows us to push a copy of the content into Squid while also returning it to the client at the same time.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk