Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have just started using more javascript in the web interface of an internal application(php if it matters). Now that the changes are in place it is becoming very obvious that the more javascript on the page, the slower the page loads through squid.

Any suggestions on why this is happening? I don't want the question to be to vague but I don't want to suggest somthing when I don't know what I'm looking for.

One thing that occurred to me: What if the pages without javascript aren't getting cached, and our squid server is secretly slow? How do I test this?

Please, enlighten me!

Update 1 All of the javascript is cached, and being pulled from the proxy server. The largest chunk data wise (~60k) is the generated html and that is a miss every time.

Update 2 There is no ajax, the javascript is confined to a floating toolbar and handles some text pre-parsing for a search feature, its simple rule based "If it has x many characters look for a matching order number" kind of thing.
Upon closer inspection all the cached javascript is checked if its the newest version before being sent on. Triggering a TCP_REFRESH_HIT/304 I have a feeling this may be my bottleneck.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Inspect your squid access log and look for TCP_HIT. This will tell you what pages are getting delivered from cache vs being forwarded on.

share|improve this answer
    
You know, I have actually used that stat before, but now that I needed it I completely forgot about it. I'll edit my post with the results. –  Chance Jul 7 '09 at 16:22

From the client, you can't be absolutely sure if you're connecting via the squid. You might have the X-Forwarded-For header present.

Also, try to access the site directly. Is it fast, then, or is it just your browser itself being slow due to the whole JavaScript business?

share|improve this answer
    
Its noticeably faster without the proxy, and there really isn't that much javascript. No ajax or anything, just a toolbar. –  Chance Jul 7 '09 at 19:12

What exactly do you mean by "started using more javascript"? If you're putting in AJAX with numerous simultaneous calls/retrieves then you might be hitting the limit for simultaneous client connections.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.