Categories
Technology

How much cache do you have?

No, I am not miss-spelling cash. I am talking about Web Cache. It’s a feature/service that you knowingly or unknowingly use on a daily basis.

“A Web cache sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the responses — like HTML pages, images and files (collectively known as representations) — for itself. Then, if there is another request for the same URL, it can use the response that it has, instead of asking the origin server for it again.”

The simple version:
“Every browser has a place where they store bits and pieces of websites that you visit – images, ads, scripts, etc. – so that the next time you visit that particular site, you will see the page load quickly.”

There are two main reasons that Web caches are used:
* To reduce latency
* To reduce network traffic

There are three different kinds of Web Caches:
* Browser
* Proxy
* Gateway

Lets take a look at each one…

Browser
This cache is stored on your local hard drive. There is a limit of how much disk space it will use, lets say an average of 60MB may be allocated.

Proxy
This method is mostly used by small/large businesses and schools. A web proxy is a server/computer that sites between the user (you) and the internal/external network. A we proxy serves hundred, if not, thousands of users. It caches on a larger scale. It also uses a more shared cache environment.

Gateway
“Also known as “reverse proxy caches” or “surrogate caches,” gateway caches are also intermediaries, but instead of being deployed by network administrators to save bandwidth, they’re typically deployed by Webmasters themselves, to make their sites more scalable, reliable and better performing. Requests can be routed to gateway caches by a number of methods, but typically some form of load balancer is used to make one or more of them look like the origin server to clients. Content delivery networks (CDNs) distribute gateway caches throughout the Internet (or a part of it) and sell caching to interested Web sites. Akamai is a perfect example of a CDN.” In a nutshell, data replication is done in multiple geo locations for faster content access.

How Web Caches Work
“All caches have a set of rules that they use to determine when to serve a representation from the cache, if it’s available. Some of these rules are set in the protocols (HTTP 1.0 and 1.1), and some are set by the administrator of the cache (either the user of the browser cache, or the proxy administrator).”

If you’d like, you can check a websites HTTP resources to see how they’ll behave at http://redbot.org.

I hope this helps you get that much closer to learning how computers and the internet works.

Sources
mnot.net

Websearch.about.com

Comments

By Tommy Elmesewdy

DevOps Engineer