IIS won't recognize if an ASP page has been changed

  • Thread starter Michael G. Schneider
  • Start date
M

Michael G. Schneider

With Windows 2003 Server...

Imagine the following scenario: there is a simple ASP page, for example just
a single Response.Write statement. There is a virtual directory pointing to
the directory, where the ASP page is stored.

If I change this ASP page and hit the refresh button on the client browser.
I can then see the following behaviour:

[1] If the ASP page had been stored in the local file system of the IIS
Server, anything works fine. The client immediately sees the change.

[2] If the ASP page had been stored in the file system of another Windows
2003 server, the first refresh does not work. The old content is sent to the
browser. One has to refresh a second time, for getting the new contents.

The wrong result can be seen, even if the following scenario is performed...

- open new browser
- load ASP page
- change the ASP page on the server
- open a new browser
- load the ASP page

After loading the ASP page in a separate browser window, the old contents
can be seen.

Can anybody reproduce this behaviour? Is it already known? Is there a
solution?

Michael G. Schneider
 
E

Evertjan.

Michael G. Schneider wrote on 16 nov 2003 in
microsoft.public.inetserver.asp.general:
The wrong result can be seen, even if the following scenario is
performed...

- open new browser
- load ASP page
- change the ASP page on the server
- open a new browser
- load the ASP page

After loading the ASP page in a separate browser window, the old
contents can be seen.

Can anybody reproduce this behaviour? Is it already known? Is there a
solution?

Tap your favored tune on the F5 key.

More serious,
Is it already known?

Yes, this is normal behavour.
Is there a solution?

Shorten the expiring time of the page, perhaps even to zero:

<% Response.Expires = 0 %>

How else could the new browser[window] know that the cached page is not
reflecting the newest content anymore?
 
M

Michael G. Schneider

Tap your favored tune on the F5 key.
More serious,
Is it already known?

Yes, this is normal behavour.
Is there a solution?

Shorten the expiring time of the page, perhaps even to zero:

<% Response.Expires = 0 %>

How else could the new browser[window] know that the cached page is not
reflecting the newest content anymore?


It's probably my bad English. It seems, as if I did not ask my question
correctly. Maybe I should emphasize the following...

- I am sure, that this is no client side feature.

- If it were a client side feature, why should the refresh be immediately
visible, if the ASP page is saved in the IIS local file system?

- If it were a client side feature, why should the refreshed contents be
visible on the second trial, just some milliseconds after the first one?

- The observation cannot be seen under Windows 2000 Server. There the new
contents is always presented. It does not matter, whether the ASP page is
saved in the IIS local file system or on another server.

- I believe it has to do with how IIS in Windows 2003 Server handles virtual
directories located on another server.

Michael G. Schneider
 
A

Aaron Bertrand [MVP]

Usually to prevent a *browser* from caching pages locally or on a proxy, you
*must* send cache-busting headers to the client.

However, depending on IIS settings, it has also been known to keep around
"sticky" old versions of a page in its cache (this is not specific to IIS 6
and is not directly related to the location of the virtual directory).
Sometimes you have to "kick" IIS to make it release its cache.

To see both techniques see http://www.aspfaq.com/2022


Michael G. Schneider said:
Tap your favored tune on the F5 key.
More serious,
Is it already known?

Yes, this is normal behavour.
Is there a solution?

Shorten the expiring time of the page, perhaps even to zero:

<% Response.Expires = 0 %>

How else could the new browser[window] know that the cached page is not
reflecting the newest content anymore?


It's probably my bad English. It seems, as if I did not ask my question
correctly. Maybe I should emphasize the following...

- I am sure, that this is no client side feature.

- If it were a client side feature, why should the refresh be immediately
visible, if the ASP page is saved in the IIS local file system?

- If it were a client side feature, why should the refreshed contents be
visible on the second trial, just some milliseconds after the first one?

- The observation cannot be seen under Windows 2000 Server. There the new
contents is always presented. It does not matter, whether the ASP page is
saved in the IIS local file system or on another server.

- I believe it has to do with how IIS in Windows 2003 Server handles virtual
directories located on another server.

Michael G. Schneider
 
M

Michael G. Schneider

Aaron Bertrand said:
Usually to prevent a *browser* from caching pages locally or on a proxy, you
*must* send cache-busting headers to the client.

However, depending on IIS settings, it has also been known to keep around
"sticky" old versions of a page in its cache (this is not specific to IIS 6
and is not directly related to the location of the virtual directory).
Sometimes you have to "kick" IIS to make it release its cache.

To see both techniques see http://www.aspfaq.com/2022

These techniques do not work in my scenario. Moreover the browser has the
"search for new versions of a page on each and every access" setting
(translation probably not 100% correct).

Here in my case, it is definitely a question of whether the ASP page is
stored locally or remotely. The good behaviour (local) and the bad behaviour
(remote) can be reproduced any number of times.

If anybody has some time to test this on his 2003-servers, I would be happy
to hear the results.

With Windows 2000 the IIS relied on change notification to find out, whether
a certain ASP page has been modified. Does anybody know, whether this has
changed?

Michael G. Schneider
 
M

Michael G. Schneider

I have seen this under Windows 2000 Server / IIS 5 too. I highly
suspect it's just plain old browser caching ;-)

No, unfortunately it is not browser caching
Here's what you should try (I amended your list) :

Ok, I tried, I even tried some more as...

- open new browser
- load ASP page
- change the ASP page on the server
- CLOSE BROWSER
- OPEN BROWSER
- DELETE COOKIES
- DELETE TEMPORARY FILES
- DELETE HISTORY
- CLOSE BROWSER
- open a new browser
- load the ASP page

I even tried more...

- open new browser
- load ASP page
- change the ASP page on the server
- GO TO ANOTHER PC
- open a new browser
- load the ASP page

And yes, the loading the ASP page after it has been modified, still shows
the old contents. The ASP page has to be requested twice, in order for the
new contents showing up.

Did you actually test this scenario (virtual directory on another 2003
server)?

Michael G. Schneider
 
M

Michael G. Schneider

I only tested that scenario under 2000 server, with virtual dirs *on the
same server*, and the close/open browser worked in that case.

I have been using the 2000 server scenario for years. I do know that it
works.
When you try from another pc, is it on the same network ? Have you tried
accessing the site from an external ip ?

This is a small network. Three Windows 2003 servers, some workstations. All
belong to the same domain.

No I did not try it from outside. I have to make it work in this network,
anyway. This feature is very disturbing, when it comes to testing an ASP
application. There you often change an ASP page, and one wants to see the
results immediateley, and not after hitting submit twice.

Michael G. Schneider
 

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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top