This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How does HTTP caching works in a proxy server?

0

It's my understanding that caching is one of the main utilities of a proxy server. I'm currently trying to develop a simple one and I would like to know exactly how caching works.

Intuitively I think that it's basically an association between a request and a response. For example: for the following request: "GET google.com" you have the following response: "HTTP/1.0 200 OK..."

That way, whenever the proxy server receives a request for that URL he can reply with the cached response (I'm not really worried right now about when to serve the cached response and when to actually send the request to the real destination).

What I don't understand is how to establish the association between a request and a response since the HTTP response doesn't have any field saying "hey this is the response you get when you request the X URL" (or does it?).

Should I get this information by analyzing the underlying protocols? If so, how?

asked 02 Aug '13, 06:44

Andr%C3%A9%20Louren%C3%A7o's gravatar image

André Lourenço
1222
accept rate: 0%

Not really a wireshark question, you should look for answers on a support forum more appropriate, e.g. for squid.

(04 Aug '13, 08:17) grahamb ♦

One Answer:

0

This question is actually unrelated to Wireshark (as @grahamb already wrote). To understand HTTP caching, you need a profound understanding of the HTTP protocol and that's where Wireshark can help (besides online resources and books).

Wireshark Tutorial for HTTP (I did not check the quality of the content!)

http://www.youtube.com/watch?v=0wx9xfbe7B4

BTW: searching google for http caching explained returns these URLs and many more.

https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers
http://www.mnot.net/cache_docs/
http://www.kaizou.org/2009/02/http-caching-explained/
http://tech.deepumohan.com/2012/08/http-caching-explained.html

Regards
Kurt

answered 08 Aug '13, 06:38

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%