Eric B. wrote:
"Amos Jeffries" <squid3@xxxxxxxxxxxxx> wrote in message
news:499751AD.5030706@xxxxxxxxxxxxxxxx
Eric B. wrote:
I've found a noticable speed increase (50%) in all sites when I placed a
squid box in front of the web servers. But your experience may vary.
Wow - that's amazing. I guess I'm a little confused as to how / why squid
is so much more effective at serving static content than apache would be for
instance. Given the same static image or the same static html, what makes
squid so much better / faster?
In my case it was dramatic because the apache was slowed down serving
other sites as well as proxying for tomcat.
I guess I can see squid would end up offloading some of the processing
from tomcat, but if I were to put them on the same server, then it ends
up being the same CPU/disk that get used, so I don't see any advantages
there either - the processing power just gets shifted from one app to
another.
Tomcat will attempting to re-generate content it does not have to, simply
because it has a dynamic type or because its not storing the response
headers. Squid will fix this minor CPU waste.
As I said though if they are on different boxes, that is when savings are
maximized.
How does squid know what is static and can be cached, and what is dynamic?
As far as squid is concerned its all 'static' (dynamic stuff is
pre-created by tomcat by the time it reaches squid).
The HTTP headers tell squid how long things can be cached for, or not in
some cases.
Is that based on configuration of file extensions? ie: cache html pages,
jpg and gif, but not php and jsp? Furthermore, if a request is made with
the same uri & query string, will squid cache the result?
If the headers permit yes.
Query strings, may need a little adjustment to the configuration on
older squid:
http://wiki.squid-cache.org/ConfigExamples/DynamicContent
Amos
--
Please be using
Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
Current Beta Squid 3.1.0.5