Client doesn't send If-None-Match so server always returns 200

O

Ofer Zelig

Hello,

I have a simple AJAX-enabled (RC 1.0) web site. Runs perfectly on my local
machine (debugged by VS IDE).
The problem is that on remote ("prodction") machine, every "satellite"
file - JS, GIF etc. gets downloaded every time. I see it using HttpWatch (a
tool similar to Fiddler).
Locally, the client appropriately sends If-None-Match header so the server
returns 304 Not Modified as needed. But accessing the remote version, the
client doens't send this header, so the server always returns 200 and a full
stream.

I'd appreciate your help!

Thanks,
Ofer
 
L

Laurent Bugnion [MVP]

Hi,

Ofer said:
Hello,

I have a simple AJAX-enabled (RC 1.0) web site. Runs perfectly on my local
machine (debugged by VS IDE).
The problem is that on remote ("prodction") machine, every "satellite"
file - JS, GIF etc. gets downloaded every time. I see it using HttpWatch (a
tool similar to Fiddler).
Locally, the client appropriately sends If-None-Match header so the server
returns 304 Not Modified as needed. But accessing the remote version, the
client doens't send this header, so the server always returns 200 and a full
stream.

I'd appreciate your help!

Thanks,
Ofer

Could that be as simple as a cache setting problem in the client? We had
that kind of issue at work once with our system tester, until we noticed
that their cache was set to "refresh everytime I visit the webpage".
Changing that setting to "Automatically" took care of the problem.

For IE7: Internet Options / General / Browsing history settings.

HTH,
Laurent
 
O

Ofer Zelig

No, it's the default setting - Automatic.
And I use the same client to the local site and the remote one...


Laurent Bugnion said:
Hi,

Ofer said:
Hello,

I have a simple AJAX-enabled (RC 1.0) web site. Runs perfectly on my local
machine (debugged by VS IDE).
The problem is that on remote ("prodction") machine, every "satellite"
file - JS, GIF etc. gets downloaded every time. I see it using HttpWatch (a
tool similar to Fiddler).
Locally, the client appropriately sends If-None-Match header so the server
returns 304 Not Modified as needed. But accessing the remote version, the
client doens't send this header, so the server always returns 200 and a full
stream.

I'd appreciate your help!

Thanks,
Ofer

Could that be as simple as a cache setting problem in the client? We had
that kind of issue at work once with our system tester, until we noticed
that their cache was set to "refresh everytime I visit the webpage".
Changing that setting to "Automatically" took care of the problem.

For IE7: Internet Options / General / Browsing history settings.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
W

Walter Wang [MSFT]

Hi Ofer,

Can you confirm that it's AJAX related? I mean, does a static html file
uses the GIF/JS file also has this issue?

If the client is not sending the header, it's probably a client-side issue.
Try other browsers or other systems to verify this.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
O

Ofer Zelig

Hi Walter,

Regular HTML file works fine. It sends If-None-Match as needed and gets 304.
A simple ASPX page, which only contains an IMG tag also works fine.
The main and specific problem is with JS files. Local site sends
If-None-Match and remote one doesn't. This happens even in a very simple
ASPX page which doesn't include AJAX code at all, and contains only a SCRIPT
tag.
As mentioned, as use the same IE client for both local and remote requests
so I can't understand the difference in behavior. I can't perform a test on
other browser (FireFox for eaxmple) because I don't have a tool similar to
HttpWatch to work with in that browser... so the problem, in my opinion,
focuses on the different behavior of ASP.NET engine between running locally
and remotely, and I can't point out the exact problem.

Thanks,
Ofer
 
W

Walter Wang [MSFT]

Hi Ofer,

Your IIS on remote server probably disabled cache. Here's my test steps to
make a javascript file not cached by client browser:

1) On the remote server, open IIS manager, select the javascript file (or
you can select a virtual directory or even the whole web site), open its
properties dialog
2) In tab "HTTP Headers", check "Enable content expiration", in the field
"Web site content should", select "Expire immediately"; select OK to close
the properties dialog
3) At client-side, clear the local cache (I'm using Fiddler, therefore I
simply selected menu "Tools/Clear WinINET Cache" to clear it) and visit the
page again, refresh several times, you will see the request header doesn't
contain the if-non-match anymore since server responded with "Pragma:
no-cache".

Please check if this is the case on your remote server and let me know the
result. Thanks.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top