473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Cache feature doesn't produce expected result (bug?)

Hi,

I think this question requires an in depth understanding of how a browser
cache works. I hope I can reach an expert here.

I may have found a quirk in the asp.net documentation or I don't understand
what the SetAllowResponseInBrowserHistory does.
While researching caching I tried the code sample at the following page :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

I find this code absurd since it tries to show that you can view a page that
has been _posted_ with the history feature of the browser.

Can you try this code and report your findings please? I tried it on a clean
VM install and on my dev pc: the browser says "page expired".
The docs say you would see the old page in the browser.

I did some tests and this is what the following code does with the response
headers :

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Fa lse) ' False
is the default
'Cache-Control: no-cache
'Expires: -1
'Pragma: no - Cache

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
'Cache-Control: no-cache
'Pragma: no - Cache
The docs are right about the Expires header. When SetAllowResponseInBrowserHistory
= True the Expires header disappears.

Does anybody have a clue why SetAllowResponseInBrowserHistory was called
into existence and where it might be useful?

Thanks,
Tom Pester
Nov 19 '05 #1
14 2063
re:
Does anybody have a clue why SetAllowResponseInBrowserHistory was called into existence
and where it might be useful?
SetAllowResponseInBrowserHistory(false) is the default.

You only need to set HttpCachePolicy.SetAllowResponseInBrowserHistory
when you need to set it to true to override the NoCache setting


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om... Hi,

I think this question requires an in depth understanding of how a browser cache works. I
hope I can reach an expert here.

I may have found a quirk in the asp.net documentation or I don't understand what the
SetAllowResponseInBrowserHistory does.
While researching caching I tried the code sample at the following page :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

I find this code absurd since it tries to show that you can view a page that has been
_posted_ with the history feature of the browser.

Can you try this code and report your findings please? I tried it on a clean VM install
and on my dev pc: the browser says "page expired".
The docs say you would see the old page in the browser.

I did some tests and this is what the following code does with the response headers :

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Fa lse) ' False is the default
'Cache-Control: no-cache
'Expires: -1
'Pragma: no - Cache

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
'Cache-Control: no-cache
'Pragma: no - Cache
The docs are right about the Expires header. When SetAllowResponseInBrowserHistory =
True the Expires header disappears.

Does anybody have a clue why SetAllowResponseInBrowserHistory was called into existence
and where it might be useful?

Thanks,
Tom Pester

Nov 19 '05 #2
Hi Juan,

Thanks for your response.
You only need to set HttpCachePolicy.SetAllowResponseInBrowserHistory
when you need to set it to true to override the NoCache setting


Setting SetAllowResponseInBrowserHistory to True doesn't touch/override the
"no-cache" value. It only removes the expires=-1 header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache

I don't know if you are experienced in http headers and their behavior but
could you please test the code that's on this page and report your result? :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you will find
that the text on the page is wrong.

Thanks in advance, Tom
Nov 19 '05 #3
re:
You only need to set HttpCachePolicy.SetAllowResponseInBrowserHistory
when you need to set it to true to override the NoCache setting
Setting SetAllowResponseInBrowserHistory to True doesn't touch/override the "no-cache"
value. It only removes the expires=-1 header.


Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache" value.

When HttpCacheability is set to NoCache or ServerAndNoCache
the Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to
not cache responses in the History folder by setting that header.

This means that each time you use the back/forward buttons,
the client requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True,
the Expires HTTP header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(True)
and alternate between clicking the Submit button and the Back button,
you'll see that the "This page has expired" message is not displayed.

That means that the client *has* requested a new version of the page,
without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)
you'll see that immediately the "This page has expired" message *is* displayed,
and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(True)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not displayed,
and the page is displayed without needing to resubmit the page.

The documentation is wrong in requesting that you
"Click the Submit button a few times".

That throws a wrench into the works.
You should only hit it once to see the correct behavior.

The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.

In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om... Hi Juan,

Thanks for your response.
You only need to set HttpCachePolicy.SetAllowResponseInBrowserHistory
when you need to set it to true to override the NoCache setting


Setting SetAllowResponseInBrowserHistory to True doesn't touch/override the "no-cache"
value. It only removes the expires=-1 header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache

I don't know if you are experienced in http headers and their behavior but could you
please test the code that's on this page and report your result? :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you will find that the text
on the page is wrong.

Thanks in advance, Tom

Nov 19 '05 #4
Hi Juan,

I tried exactly the steps that you advised but this is where I can't reproduce
If you set HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False) you'll see that immediately the "This page has expired" message *is* displayed,
and the client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out SetAllowResponseInBrowserHistory
I get the same result as False is the default. No "This page has expired"
message, the browser request a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I even
made a video of my clean virtual machine (just SP2 installed) to show you
my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar

Do you realy get a "This page has expired" when you do what's on the video?
I don't.

Setting SetAllowResponseInBrowserHistory to true or false... I never see
a difference.

Cheers,
Tom Pester

re:
You only need to set
HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
set it to true to override the NoCache setting

Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache"
value.

When HttpCacheability is set to NoCache or ServerAndNoCache the
Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to not cache
responses in the History folder by setting that header.

This means that each time you use the back/forward buttons, the client
requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True, the Expires HTTP
header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue) and alternate between clicking the Submit button and the Back
button, you'll see that the "This page has expired" message is not
displayed.

That means that the client *has* requested a new version of the page,
without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse) you'll see that immediately the "This page has expired" message
*is* displayed, and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not displayed,
and the page is displayed without needing to resubmit the page.
The documentation is wrong in requesting that you
"Click the Submit button a few times".
That throws a wrench into the works.
You should only hit it once to see the correct behavior.
The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.

In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

Thanks for your response.
You only need to set
HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
set it to true to override the NoCache setting

Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache
I don't know if you are experienced in http headers and their
behavior but could you please test the code that's on this page and
report your result? :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you will
find that the text on the page is wrong.

Thanks in advance, Tom

Nov 19 '05 #5
re:
Could it be that you saw this when testing without restarting IE?
I didn't restart IE, thinking that editing the source file would
automatically force recompilation ( and return a new page anyway ).

Let me take a look at it while closing IE, and I'll post back.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om... Hi Juan,

I tried exactly the steps that you advised but this is where I can't reproduce
If you set HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)

you'll see that immediately the "This page has expired" message *is* displayed, and the
client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out
SetAllowResponseInBrowserHistory I get the same result as False is the default. No "This
page has expired" message, the browser request a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I even made a video of
my clean virtual machine (just SP2 installed) to show you my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar

Do you realy get a "This page has expired" when you do what's on the video? I don't.

Setting SetAllowResponseInBrowserHistory to true or false... I never see a difference.

Cheers,
Tom Pester

re:
You only need to set
HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
set it to true to override the NoCache setting

Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache"
value.

When HttpCacheability is set to NoCache or ServerAndNoCache the
Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to not cache
responses in the History folder by setting that header.

This means that each time you use the back/forward buttons, the client
requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True, the Expires HTTP
header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue) and alternate between clicking the Submit button and the Back
button, you'll see that the "This page has expired" message is not
displayed.

That means that the client *has* requested a new version of the page,
without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse) you'll see that immediately the "This page has expired" message
*is* displayed, and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not displayed,
and the page is displayed without needing to resubmit the page.
The documentation is wrong in requesting that you
"Click the Submit button a few times".
That throws a wrench into the works.
You should only hit it once to see the correct behavior.
The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.

In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

Thanks for your response.

You only need to set
HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
set it to true to override the NoCache setting

Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache
I don't know if you are experienced in http headers and their
behavior but could you please test the code that's on this page and
report your result? :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you will
find that the text on the page is wrong.

Thanks in advance, Tom


Nov 19 '05 #6
Thx for sticking with this Juan. I dont have an urgent problem with this
feature, I just whant to know everyting there is about caching cause I neglected
it for too long.
This SetAllowResponseInBrowserHistory is one of the last mysteries for me.

Thanks,
Tom Pester

PS I am using ASP.NET V2 Beta 2 so the page recompiles every time I make
a change.

re:
Could it be that you saw this when testing without restarting IE?

I didn't restart IE, thinking that editing the source file would
automatically force recompilation ( and return a new page anyway ).

Let me take a look at it while closing IE, and I'll post back.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

I tried exactly the steps that you advised but this is where I can't
reproduce
If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
False)

you'll see that immediately the "This page has expired" message *is*
displayed, and the client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out
SetAllowResponseInBrowserHistory I get the same result as False is
the default. No "This page has expired" message, the browser request
a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I
even made a video of my clean virtual machine (just SP2 installed) to
show you my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar
Do you realy get a "This page has expired" when you do what's on the
video? I don't.

Setting SetAllowResponseInBrowserHistory to true or false... I never
see a difference.

Cheers,
Tom Pester
re:

> You only need to set
> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
> set it to true to override the NoCache setting
>
Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache"
value.

When HttpCacheability is set to NoCache or ServerAndNoCache the
Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to not cache
responses in the History folder by setting that header.

This means that each time you use the back/forward buttons, the
client requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True, the Expires
HTTP header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr ue) and alternate between clicking the Submit button and the Back
button, you'll see that the "This page has expired" message is not
displayed.

That means that the client *has* requested a new version of the
page, without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse) you'll see that immediately the "This page has expired"
message *is* displayed, and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr
ue)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not
displayed,
and the page is displayed without needing to resubmit the page.
The documentation is wrong in requesting that you
"Click the Submit button a few times".
That throws a wrench into the works.
You should only hit it once to see the correct behavior.
The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.
In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

Thanks for your response.

> You only need to set
> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
> set it to true to override the NoCache setting
>
Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache
I don't know if you are experienced in http headers and their
behavior but could you please test the code that's on this page and
report your result? :
http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you
will find that the text on the page is wrong.

Thanks in advance, Tom

Nov 19 '05 #7
OK...

First test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache)
and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(True)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.

Browser does produce "Page has expired" message
if the submit button is clicked more than once.

Single-click behavior returns different time stamps for each page.

Browser closed.

Second test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache)
was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(True)
is left in code

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.

Browser does produce "Page has expired" message
if the submit button is clicked more than once.

Single-click behavior returns different time stamps for each page.

( same results as the first test )

Browser closed.

Third test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache)
and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.

Browser does produce "Page has expired" message
if the submit button is clicked more than once.

Single-click behavior returns different time stamps for each page.

( same results as the first and second tests )

Browser closed.

Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache)
was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)
was left in code.

Results :
Browser doesn't produce "Page has expired" message at any time.

Browser allows returning to previous versions of page ( as determined
by the date stamp ) no matter how many times the submit button is
pressed successively.

Whew !

Analysis :
The only time the code works as expected is when
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache)
is commented out and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)
is left in the code.

My conclusions :

1. setting NoCache invalidates SetAllowResponseInBrowserHistory
regardless of whether SetAllowResponseInBrowserHistory is set to True or False.

2. If NoCache isn't set but SetAllowResponseInBrowserHistory is set to True
the response is the opposite of what it should be. I would expect SetAllowREsponse
InBrowserHistory to, precisley, allow the browser to use its history cache.

3. if SetAllowResponseInBrowserHistory is set to False *and*
SetCacheability(HttpCacheability.NoCache) is *not* set
then everything works, sort of, since the result is exactly the opposite
of what I would have expected.

It seems that the functionality of SetAllowResponseInBrowserHistory
works if set to False instead of being set to True, but only if NoCache
isn't set previously.

This is very strange, but I've seen stranger.

I will escalate this up the line to PSS, and try to get a reply.
When I do, I'll post it back.

Before doing that, I'll wait for any last comments you might have.
Thanks for pointing this out.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

I tried exactly the steps that you advised but this is where I can't reproduce
If you set HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)

you'll see that immediately the "This page has expired" message *is* displayed, and the
client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out
SetAllowResponseInBrowserHistory I get the same result as False is the default. No "This
page has expired" message, the browser request a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I even made a video of
my clean virtual machine (just SP2 installed) to show you my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar

Do you realy get a "This page has expired" when you do what's on the video? I don't.

Setting SetAllowResponseInBrowserHistory to true or false... I never see a difference.

Cheers,
Tom Pester

re:
You only need to set
HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
set it to true to override the NoCache setting

Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache"
value.

When HttpCacheability is set to NoCache or ServerAndNoCache the
Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to not cache
responses in the History folder by setting that header.

This means that each time you use the back/forward buttons, the client
requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True, the Expires HTTP
header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue) and alternate between clicking the Submit button and the Back
button, you'll see that the "This page has expired" message is not
displayed.

That means that the client *has* requested a new version of the page,
without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse) you'll see that immediately the "This page has expired" message
*is* displayed, and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not displayed,
and the page is displayed without needing to resubmit the page.
The documentation is wrong in requesting that you
"Click the Submit button a few times".
That throws a wrench into the works.
You should only hit it once to see the correct behavior.
The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.

In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

Thanks for your response.

You only need to set
HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
set it to true to override the NoCache setting

Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache
I don't know if you are experienced in http headers and their
behavior but could you please test the code that's on this page and
report your result? :

http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you will
find that the text on the page is wrong.

Thanks in advance, Tom


Nov 19 '05 #8
Hi Juan,

I want to point out that History mechanisms and caches are different in case
you didn't know.
You can read about it in section 13.13 at http://www.faqs.org/rfcs/rfc2616.html
Although I think IE doesn't follow this section ( a cache-control:no-cache
does mean a request to the server if you hit back), there could be some semantic
differences we have to take into account when talking about the history feature
and the browser cache.
1. setting NoCache invalidates SetAllowResponseInBrowserHistory regardless of whether SetAllowResponseInBrowserHistory is set to True or False.

I watched the headers going back and forth and SetAllowResponseInBrowserHistory
= True only takes away the expires=-1 header if SetCacheability is set to
NoCache.
But this has no effect on the browsers behavior. All your tests returned
the same result as well as mine. So I think the question is what does expires=-1
try to do and why would you want to get rid of it?
2. If NoCache isn't set but SetAllowResponseInBrowserHistory is set to True
the response is the opposite of what it should be. I would expect SetAllowREsponse
InBrowserHistory to, precisley, allow the browser to use its history cache.
if I Make SetAllowResponseInBrowserHistory True than I _do_ get the page
from the cache but this is actually the default behavior of asp.net :
the cache-control header is set to private and the SetAllowResponseInBrowserHistory
could as well be commented out. It doesn't add or change any headers on its
own.

You get a fresh page?
3. if SetAllowResponseInBrowserHistory is set to False *and*
SetCacheability(HttpCacheability.NoCache) is *not* set
then everything works, sort of, since the result is exactly the opposite
of what I would have expected.
The cached page is displayed right? But this contradicts SetAllowResponseInBrowserHistory=False
or its confusing at least.
It seems that the functionality of SetAllowResponseInBrowserHistory works if set to False instead of being set to True, but only if NoCache isn't set
previously.

So you have found a page where setting the SetAllowResponseInBrowserHistory
to True or False did influence the outcome??
My test say that SetAllowResponseInBrowserHistory doesn't do anything that's
noticeable for the end user
It does however remove the Expires=-1 header when you set SetCacheability
to HttpCacheability.NoCache but like I said this doesn't effect a thing in
my findings.
I will escalate this up the line to PSS, and try to get a reply. When I

do, I'll post it back.

Seems I found the right person :) Asking the right question is important.
This is what I would ask:

Can you give a code sample where SetAllowResponseInBrowserHistory does have
an effect on the end user experience?

Notice that I don't ask what SetAllowResponseInBrowserHistory is supposed
to do because after so many tests I don't make any assumption on what it
is trying to accomplish.
I hope that with a code sample we can see the effect ourselves and draw conclusions
from it.

Cheers,
Tom Pester
Nov 19 '05 #9
Hi Juan,

To come back to your fourth test that differed from the previous ones:
"Fourth test : HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache)
was commented out HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)
was left in code."

If you dont use SetCacheability on a page than ASP switches back to its default
cache-control wich is private, ie the browser may cache the page. So you
can press the submit button many times and still go back in history.
Setting SetAllowResponseInBrowserHistory to False of True has no effect at
all on the headers so it could as well be commented out.

Can you report this issue a level higher please?

Let me know if you have any more questions..

Cheers,
Tom Pester
OK...

First test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.

Browser closed.

Second test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache)
was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)
is left in code
Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.

( same results as the first test )

Browser closed.

Third test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.

( same results as the first and second tests )

Browser closed.

Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache) was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse) was left in code.

Results :
Browser doesn't produce "Page has expired" message at any time.
Browser allows returning to previous versions of page ( as determined
by the date stamp ) no matter how many times the submit button is
pressed successively.

Whew !

Analysis :
The only time the code works as expected is when
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache)
is commented out and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse)
is left in the code.
My conclusions :

1. setting NoCache invalidates SetAllowResponseInBrowserHistory
regardless of whether SetAllowResponseInBrowserHistory is set to True
or False.

2. If NoCache isn't set but SetAllowResponseInBrowserHistory is set to
True
the response is the opposite of what it should be. I would expect
SetAllowREsponse
InBrowserHistory to, precisley, allow the browser to use its history
cache.
3. if SetAllowResponseInBrowserHistory is set to False *and*
SetCacheability(HttpCacheability.NoCache) is *not* set
then everything works, sort of, since the result is exactly the
opposite
of what I would have expected.
It seems that the functionality of SetAllowResponseInBrowserHistory
works if set to False instead of being set to True, but only if
NoCache isn't set previously.

This is very strange, but I've seen stranger.

I will escalate this up the line to PSS, and try to get a reply. When
I do, I'll post it back.

Before doing that, I'll wait for any last comments you might have.
Thanks for pointing this out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

I tried exactly the steps that you advised but this is where I can't
reproduce
If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
False)

you'll see that immediately the "This page has expired" message *is*
displayed, and the client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out
SetAllowResponseInBrowserHistory I get the same result as False is
the default. No "This page has expired" message, the browser request
a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I
even made a video of my clean virtual machine (just SP2 installed) to
show you my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar
Do you realy get a "This page has expired" when you do what's on the
video? I don't.

Setting SetAllowResponseInBrowserHistory to true or false... I never
see a difference.

Cheers,
Tom Pester
re:

> You only need to set
> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
> set it to true to override the NoCache setting
>
Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache"
value.

When HttpCacheability is set to NoCache or ServerAndNoCache the
Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to not cache
responses in the History folder by setting that header.

This means that each time you use the back/forward buttons, the
client requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True, the Expires
HTTP header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr ue) and alternate between clicking the Submit button and the Back
button, you'll see that the "This page has expired" message is not
displayed.

That means that the client *has* requested a new version of the
page, without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse) you'll see that immediately the "This page has expired"
message *is* displayed, and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr
ue)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not
displayed,
and the page is displayed without needing to resubmit the page.
The documentation is wrong in requesting that you
"Click the Submit button a few times".
That throws a wrench into the works.
You should only hit it once to see the correct behavior.
The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.
In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

Thanks for your response.

> You only need to set
> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
> set it to true to override the NoCache setting
>
Setting SetAllowResponseInBrowserHistory to True doesn't
touch/override the "no-cache" value. It only removes the expires=-1
header.

This code shows this :
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)

The servers send the following cache related headers :
'Cache-Control: no-cache
'Pragma: no - Cache
I don't know if you are experienced in http headers and their
behavior but could you please test the code that's on this page and
report your result? :
http://msdn2.microsoft.com/library/9...us,vs.80).aspx

If you run the sample and go back with your browser I think you
will find that the text on the page is wrong.

Thanks in advance, Tom

Nov 19 '05 #10
I just verified by commenting out
SetAllowResponseInBrowserHistory

btw, what are you using to see the headers ?

re:
Can you report this issue a level higher please?
Will do so...and post back as soon as I get an answer.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om... Hi Juan,

To come back to your fourth test that differed from the previous ones:
"Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCache) was
commented out HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(False)
was left in code."

If you dont use SetCacheability on a page than ASP switches back to its default
cache-control wich is private, ie the browser may cache the page. So you can press the
submit button many times and still go back in history.
Setting SetAllowResponseInBrowserHistory to False of True has no effect at all on the
headers so it could as well be commented out.

Can you report this issue a level higher please?

Let me know if you have any more questions..

Cheers,
Tom Pester
OK...

First test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.

Browser closed.

Second test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache)
was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Tr
ue)
is left in code
Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.

( same results as the first test )

Browser closed.

Third test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.

( same results as the first and second tests )

Browser closed.

Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache) was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse) was left in code.

Results :
Browser doesn't produce "Page has expired" message at any time.
Browser allows returning to previous versions of page ( as determined
by the date stamp ) no matter how many times the submit button is
pressed successively.

Whew !

Analysis :
The only time the code works as expected is when
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.No
Cache)
is commented out and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(Fa
lse)
is left in the code.
My conclusions :

1. setting NoCache invalidates SetAllowResponseInBrowserHistory
regardless of whether SetAllowResponseInBrowserHistory is set to True
or False.

2. If NoCache isn't set but SetAllowResponseInBrowserHistory is set to
True
the response is the opposite of what it should be. I would expect
SetAllowREsponse
InBrowserHistory to, precisley, allow the browser to use its history
cache.
3. if SetAllowResponseInBrowserHistory is set to False *and*
SetCacheability(HttpCacheability.NoCache) is *not* set
then everything works, sort of, since the result is exactly the
opposite
of what I would have expected.
It seems that the functionality of SetAllowResponseInBrowserHistory
works if set to False instead of being set to True, but only if
NoCache isn't set previously.

This is very strange, but I've seen stranger.

I will escalate this up the line to PSS, and try to get a reply. When
I do, I'll post it back.

Before doing that, I'll wait for any last comments you might have.
Thanks for pointing this out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

I tried exactly the steps that you advised but this is where I can't
reproduce

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
False)

you'll see that immediately the "This page has expired" message *is*
displayed, and the client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out
SetAllowResponseInBrowserHistory I get the same result as False is
the default. No "This page has expired" message, the browser request
a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I
even made a video of my clean virtual machine (just SP2 installed) to
show you my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar
Do you realy get a "This page has expired" when you do what's on the
video? I don't.

Setting SetAllowResponseInBrowserHistory to true or false... I never
see a difference.

Cheers,
Tom Pester
re:

>> You only need to set
>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
>> set it to true to override the NoCache setting
>>
> Setting SetAllowResponseInBrowserHistory to True doesn't
> touch/override the "no-cache" value. It only removes the expires=-1
> header.
>
Maybe we have a semantics problem here.

Removing the expires= -1 header *equals* overriding the "NoCache"
value.

When HttpCacheability is set to NoCache or ServerAndNoCache the
Expires HTTP header is set to -1 by default.

NoCache and ServerAndNoCache instruct the client to not cache
responses in the History folder by setting that header.

This means that each time you use the back/forward buttons, the
client requests a new version of the response.

When SetAllowResponseInBrowserHistory is set to True, the Expires
HTTP header is removed.

If you comment out this line :
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr ue) and alternate between clicking the Submit button and the Back
button, you'll see that the "This page has expired" message is not
displayed.

That means that the client *has* requested a new version of the
page, without having to resubmit the page.

If you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse) you'll see that immediately the "This page has expired"
message *is* displayed, and the client needs to resubmit the page.

Now, if you set
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr
ue)
and alternate between the Submit button and the Back button,
you'll see that the "This page has expired" message is not
displayed,
and the page is displayed without needing to resubmit the page.
The documentation is wrong in requesting that you
"Click the Submit button a few times".
That throws a wrench into the works.
You should only hit it once to see the correct behavior.
The documentation is also wrong when it states that
SetAllowResponseInBrowserHistory allows client-side caching.
In effect all it does is remove the need to resubmit the page.

I hope this makes this issue clearer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
> Hi Juan,
>
> Thanks for your response.
>
>> You only need to set
>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need to
>> set it to true to override the NoCache setting
>>
> Setting SetAllowResponseInBrowserHistory to True doesn't
> touch/override the "no-cache" value. It only removes the expires=-1
> header.
>
> This code shows this :
> Response.Cache.SetCacheability(HttpCacheability.No Cache)
> Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
>
> The servers send the following cache related headers :
> 'Cache-Control: no-cache
> 'Pragma: no - Cache
> I don't know if you are experienced in http headers and their
> behavior but could you please test the code that's on this page and
> report your result? :
> http://msdn2.microsoft.com/library/9...us,vs.80).aspx
>
> If you run the sample and go back with your browser I think you
> will find that the text on the page is wrong.
>
> Thanks in advance, Tom
>


Nov 19 '05 #11

There are a few excellent freeware/shareware tools that you can use to debug
:

- http://www.blunck.info/iehttpheaders.html
- http://www.fiddlertool.com/fiddler
- http://www.proxomitron.info

Some more links :

- http://www.ieinspector.com/httpanalyzer
- http://www.iewatch.com
- http://www.httpsniffer.com/screen.htm
- http://www.httpwatch.com/viewer.htm

Firefox has a good extension too.

Cheers,
Tom Pester
I just verified by commenting out
SetAllowResponseInBrowserHistory
btw, what are you using to see the headers ?

re:
Can you report this issue a level higher please?

Will do so...and post back as soon as I get an answer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

To come back to your fourth test that differed from the previous
ones:
"Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.N
oCache) was
commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(F
alse)
was left in code."
If you dont use SetCacheability on a page than ASP switches back to
its default
cache-control wich is private, ie the browser may cache the page. So
you can press the
submit button many times and still go back in history.
Setting SetAllowResponseInBrowserHistory to False of True has no
effect at all on the
headers so it could as well be commented out.
Can you report this issue a level higher please?

Let me know if you have any more questions..

Cheers,
Tom Pester
OK...

First test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr ue)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.
Browser closed.

Second test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No
Cache)
was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr
ue)
is left in code
Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.
( same results as the first test )

Browser closed.

Third test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.
( same results as the first and second tests )

Browser closed.

Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No Cache) was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse) was left in code.

Results :
Browser doesn't produce "Page has expired" message at any time.
Browser allows returning to previous versions of page ( as
determined
by the date stamp ) no matter how many times the submit button is
pressed successively.
Whew !

Analysis :
The only time the code works as expected is when
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No
Cache)
is commented out and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa
lse)
is left in the code.
My conclusions :
1. setting NoCache invalidates SetAllowResponseInBrowserHistory
regardless of whether SetAllowResponseInBrowserHistory is set to
True or False.

2. If NoCache isn't set but SetAllowResponseInBrowserHistory is set
to
True
the response is the opposite of what it should be. I would expect
SetAllowREsponse
InBrowserHistory to, precisley, allow the browser to use its history
cache.
3. if SetAllowResponseInBrowserHistory is set to False *and*
SetCacheability(HttpCacheability.NoCache) is *not* set
then everything works, sort of, since the result is exactly the
opposite
of what I would have expected.
It seems that the functionality of SetAllowResponseInBrowserHistory
works if set to False instead of being set to True, but only if
NoCache isn't set previously.
This is very strange, but I've seen stranger.

I will escalate this up the line to PSS, and try to get a reply.
When I do, I'll post it back.

Before doing that, I'll wait for any last comments you might have.
Thanks for pointing this out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

I tried exactly the steps that you advised but this is where I
can't reproduce

> If you set
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y( False)
>
you'll see that immediately the "This page has expired" message
*is* displayed, and the client needs to resubmit the >page.

I dont see the "This page has expired" message and if I comment out
SetAllowResponseInBrowserHistory I get the same result as False is
the default. No "This page has expired" message, the browser
request a new page as I can see by the time.

Could it be that you saw this when testing without restarting IE? I
even made a video of my clean virtual machine (just SP2 installed)
to show you my result.

Please try this:
http://users.pandora.be/TomPester/ASP/r.rar
Do you realy get a "This page has expired" when you do what's on
the
video? I don't.
Setting SetAllowResponseInBrowserHistory to true or false... I
never see a difference.

Cheers,
Tom Pester
> re:
>
>>> You only need to set
>>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need
>>> to set it to true to override the NoCache setting
>>>
>> Setting SetAllowResponseInBrowserHistory to True doesn't
>> touch/override the "no-cache" value. It only removes the
>> expires=-1 header.
>>
> Maybe we have a semantics problem here.
>
> Removing the expires= -1 header *equals* overriding the "NoCache"
> value.
>
> When HttpCacheability is set to NoCache or ServerAndNoCache the
> Expires HTTP header is set to -1 by default.
>
> NoCache and ServerAndNoCache instruct the client to not cache
> responses in the History folder by setting that header.
>
> This means that each time you use the back/forward buttons, the
> client requests a new version of the response.
>
> When SetAllowResponseInBrowserHistory is set to True, the Expires
> HTTP header is removed.
>
> If you comment out this line :
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y( Tr ue) and alternate between clicking the Submit button and the
> Back button, you'll see that the "This page has expired" message
> is not displayed.
>
> That means that the client *has* requested a new version of the
> page, without having to resubmit the page.
>
> If you set
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y( Fa lse) you'll see that immediately the "This page has expired"
> message *is* displayed, and the client needs to resubmit the page.
>
> Now, if you set
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y(
> Tr
> ue)
> and alternate between the Submit button and the Back button,
> you'll see that the "This page has expired" message is not
> displayed,
> and the page is displayed without needing to resubmit the page.
> The documentation is wrong in requesting that you
> "Click the Submit button a few times".
> That throws a wrench into the works.
> You should only hit it once to see the correct behavior.
> The documentation is also wrong when it states that
> SetAllowResponseInBrowserHistory allows client-side caching.
> In effect all it does is remove the need to resubmit the page.
> I hope this makes this issue clearer.
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Español
> Ven, y hablemos de ASP.NET...
> ======================
> <To********************@pandora.be> wrote in message
> news:a1**************************@news.microsoft.c om...
>> Hi Juan,
>>
>> Thanks for your response.
>>
>>> You only need to set
>>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need
>>> to set it to true to override the NoCache setting
>>>
>> Setting SetAllowResponseInBrowserHistory to True doesn't
>> touch/override the "no-cache" value. It only removes the
>> expires=-1 header.
>>
>> This code shows this :
>> Response.Cache.SetCacheability(HttpCacheability.No Cache)
>> Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
>>
>> The servers send the following cache related headers :
>> 'Cache-Control: no-cache
>> 'Pragma: no - Cache
>> I don't know if you are experienced in http headers and their
>> behavior but could you please test the code that's on this page
>> and
>> report your result? :
>> http://msdn2.microsoft.com/library/9...us,vs.80).aspx
>> If you run the sample and go back with your browser I think you
>> will find that the text on the page is wrong.
>>
>> Thanks in advance, Tom
>>

Nov 19 '05 #12
Hi, Tom.

OK, I've been using

http://www.blunck.info/iehttpheaders.html

Just wondered which one you're using ( you didn't tell me... )

;-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...

There are a few excellent freeware/shareware tools that you can use to debug :

- http://www.blunck.info/iehttpheaders.html - http://www.fiddlertool.com/fiddler
- http://www.proxomitron.info

Some more links :

- http://www.ieinspector.com/httpanalyzer
- http://www.iewatch.com
- http://www.httpsniffer.com/screen.htm
- http://www.httpwatch.com/viewer.htm

Firefox has a good extension too.

Cheers,
Tom Pester

I just verified by commenting out
SetAllowResponseInBrowserHistory
btw, what are you using to see the headers ?

re:
Can you report this issue a level higher please?

Will do so...and post back as soon as I get an answer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

To come back to your fourth test that differed from the previous
ones:
"Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.N
oCache) was
commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(F
alse)
was left in code."
If you dont use SetCacheability on a page than ASP switches back to
its default
cache-control wich is private, ie the browser may cache the page. So
you can press the
submit button many times and still go back in history.
Setting SetAllowResponseInBrowserHistory to False of True has no
effect at all on the
headers so it could as well be commented out.
Can you report this issue a level higher please?

Let me know if you have any more questions..

Cheers,
Tom Pester
OK...

First test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr ue)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.
Browser closed.

Second test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No
Cache)
was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Tr
ue)
is left in code
Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.
( same results as the first test )

Browser closed.

Third test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No Cache) and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse)

Results :
Browser doesn't produce "Page has expired" message
unless the submit button is clicked more than once.
Browser does produce "Page has expired" message
if the submit button is clicked more than once.
Single-click behavior returns different time stamps for each page.
( same results as the first and second tests )

Browser closed.

Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No Cache) was commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa lse) was left in code.

Results :
Browser doesn't produce "Page has expired" message at any time.
Browser allows returning to previous versions of page ( as
determined
by the date stamp ) no matter how many times the submit button is
pressed successively.
Whew !

Analysis :
The only time the code works as expected is when
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.
No
Cache)
is commented out and
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory(
Fa
lse)
is left in the code.
My conclusions :
1. setting NoCache invalidates SetAllowResponseInBrowserHistory
regardless of whether SetAllowResponseInBrowserHistory is set to
True or False.

2. If NoCache isn't set but SetAllowResponseInBrowserHistory is set
to
True
the response is the opposite of what it should be. I would expect
SetAllowREsponse
InBrowserHistory to, precisley, allow the browser to use its history
cache.
3. if SetAllowResponseInBrowserHistory is set to False *and*
SetCacheability(HttpCacheability.NoCache) is *not* set
then everything works, sort of, since the result is exactly the
opposite
of what I would have expected.
It seems that the functionality of SetAllowResponseInBrowserHistory
works if set to False instead of being set to True, but only if
NoCache isn't set previously.
This is very strange, but I've seen stranger.

I will escalate this up the line to PSS, and try to get a reply.
When I do, I'll post it back.

Before doing that, I'll wait for any last comments you might have.
Thanks for pointing this out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
> Hi Juan,
>
> I tried exactly the steps that you advised but this is where I
> can't reproduce
>
>> If you set
>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
>> y( False)
>>
> you'll see that immediately the "This page has expired" message
> *is* displayed, and the client needs to resubmit the >page.
>
> I dont see the "This page has expired" message and if I comment out
> SetAllowResponseInBrowserHistory I get the same result as False is
> the default. No "This page has expired" message, the browser
> request a new page as I can see by the time.
>
> Could it be that you saw this when testing without restarting IE? I
> even made a video of my clean virtual machine (just SP2 installed)
> to show you my result.
>
> Please try this:
> http://users.pandora.be/TomPester/ASP/r.rar
> Do you realy get a "This page has expired" when you do what's on
> the
> video? I don't.
> Setting SetAllowResponseInBrowserHistory to true or false... I
> never see a difference.
>
> Cheers,
> Tom Pester
>> re:
>>
>>>> You only need to set
>>>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need
>>>> to set it to true to override the NoCache setting
>>>>
>>> Setting SetAllowResponseInBrowserHistory to True doesn't
>>> touch/override the "no-cache" value. It only removes the
>>> expires=-1 header.
>>>
>> Maybe we have a semantics problem here.
>>
>> Removing the expires= -1 header *equals* overriding the "NoCache"
>> value.
>>
>> When HttpCacheability is set to NoCache or ServerAndNoCache the
>> Expires HTTP header is set to -1 by default.
>>
>> NoCache and ServerAndNoCache instruct the client to not cache
>> responses in the History folder by setting that header.
>>
>> This means that each time you use the back/forward buttons, the
>> client requests a new version of the response.
>>
>> When SetAllowResponseInBrowserHistory is set to True, the Expires
>> HTTP header is removed.
>>
>> If you comment out this line :
>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
>> y( Tr ue) and alternate between clicking the Submit button and the
>> Back button, you'll see that the "This page has expired" message
>> is not displayed.
>>
>> That means that the client *has* requested a new version of the
>> page, without having to resubmit the page.
>>
>> If you set
>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
>> y( Fa lse) you'll see that immediately the "This page has expired"
>> message *is* displayed, and the client needs to resubmit the page.
>>
>> Now, if you set
>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
>> y(
>> Tr
>> ue)
>> and alternate between the Submit button and the Back button,
>> you'll see that the "This page has expired" message is not
>> displayed,
>> and the page is displayed without needing to resubmit the page.
>> The documentation is wrong in requesting that you
>> "Click the Submit button a few times".
>> That throws a wrench into the works.
>> You should only hit it once to see the correct behavior.
>> The documentation is also wrong when it states that
>> SetAllowResponseInBrowserHistory allows client-side caching.
>> In effect all it does is remove the need to resubmit the page.
>> I hope this makes this issue clearer.
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Español
>> Ven, y hablemos de ASP.NET...
>> ======================
>> <To********************@pandora.be> wrote in message
>> news:a1**************************@news.microsoft.c om...
>>> Hi Juan,
>>>
>>> Thanks for your response.
>>>
>>>> You only need to set
>>>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need
>>>> to set it to true to override the NoCache setting
>>>>
>>> Setting SetAllowResponseInBrowserHistory to True doesn't
>>> touch/override the "no-cache" value. It only removes the
>>> expires=-1 header.
>>>
>>> This code shows this :
>>> Response.Cache.SetCacheability(HttpCacheability.No Cache)
>>> Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
>>>
>>> The servers send the following cache related headers :
>>> 'Cache-Control: no-cache
>>> 'Pragma: no - Cache
>>> I don't know if you are experienced in http headers and their
>>> behavior but could you please test the code that's on this page
>>> and
>>> report your result? :
>>> http://msdn2.microsoft.com/library/9...us,vs.80).aspx
>>> If you run the sample and go back with your browser I think you
>>> will find that the text on the page is wrong.
>>>
>>> Thanks in advance, Tom
>>>


Nov 19 '05 #13
Proxomitron cause I use it for other stuff too :)
Cheers,
Tom Pester
Hi, Tom.

OK, I've been using

http://www.blunck.info/iehttpheaders.html

Just wondered which one you're using ( you didn't tell me... )

;-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
There are a few excellent freeware/shareware tools that you can use
to debug :

- http://www.blunck.info/iehttpheaders.html -
http://www.fiddlertool.com/fiddler - http://www.proxomitron.info

Some more links :

- http://www.ieinspector.com/httpanalyzer
- http://www.iewatch.com
- http://www.httpsniffer.com/screen.htm
- http://www.httpwatch.com/viewer.htm
Firefox has a good extension too.

Cheers,
Tom Pester
I just verified by commenting out
SetAllowResponseInBrowserHistory
btw, what are you using to see the headers ?
re:

Can you report this issue a level higher please?

Will do so...and post back as soon as I get an answer.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
Hi Juan,

To come back to your fourth test that differed from the previous
ones:
"Fourth test :
HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability
.N
oCache) was
commented out
HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistory
(F
alse)
was left in code."
If you dont use SetCacheability on a page than ASP switches back to
its default
cache-control wich is private, ie the browser may cache the page.
So
you can press the
submit button many times and still go back in history.
Setting SetAllowResponseInBrowserHistory to False of True has no
effect at all on the
headers so it could as well be commented out.
Can you report this issue a level higher please?
Let me know if you have any more questions..

Cheers,
Tom Pester
> OK...
>
> First test :
> HttpContext.Current.Response.Cache.SetCacheability (HttpCacheabilit
> y. No Cache) and
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y( Tr ue)
>
> Results :
> Browser doesn't produce "Page has expired" message
> unless the submit button is clicked more than once.
> Browser does produce "Page has expired" message
> if the submit button is clicked more than once.
> Single-click behavior returns different time stamps for each page.
> Browser closed.
> Second test :
> HttpContext.Current.Response.Cache.SetCacheability (HttpCacheabilit
> y.
> No
> Cache)
> was commented out
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y(
> Tr
> ue)
> is left in code
> Results :
> Browser doesn't produce "Page has expired" message
> unless the submit button is clicked more than once.
> Browser does produce "Page has expired" message
> if the submit button is clicked more than once.
> Single-click behavior returns different time stamps for each page.
> ( same results as the first test )
> Browser closed.
>
> Third test :
> HttpContext.Current.Response.Cache.SetCacheability (HttpCacheabilit
> y. No Cache) and
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y( Fa lse)
>
> Results :
> Browser doesn't produce "Page has expired" message
> unless the submit button is clicked more than once.
> Browser does produce "Page has expired" message
> if the submit button is clicked more than once.
> Single-click behavior returns different time stamps for each page.
> ( same results as the first and second tests )
> Browser closed.
>
> Fourth test :
> HttpContext.Current.Response.Cache.SetCacheability (HttpCacheabilit
> y. No Cache) was commented out
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y( Fa lse) was left in code.
>
> Results :
> Browser doesn't produce "Page has expired" message at any time.
> Browser allows returning to previous versions of page ( as
> determined
> by the date stamp ) no matter how many times the submit button is
> pressed successively.
> Whew !
> Analysis :
> The only time the code works as expected is when
> HttpContext.Current.Response.Cache.SetCacheability (HttpCacheabilit
> y.
> No
> Cache)
> is commented out and
> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHistor
> y(
> Fa
> lse)
> is left in the code.
> My conclusions :
> 1. setting NoCache invalidates SetAllowResponseInBrowserHistory
> regardless of whether SetAllowResponseInBrowserHistory is set to
> True or False.
> 2. If NoCache isn't set but SetAllowResponseInBrowserHistory is
> set
> to
> True
> the response is the opposite of what it should be. I would expect
> SetAllowREsponse
> InBrowserHistory to, precisley, allow the browser to use its
> history
> cache.
> 3. if SetAllowResponseInBrowserHistory is set to False *and*
> SetCacheability(HttpCacheability.NoCache) is *not* set
> then everything works, sort of, since the result is exactly the
> opposite
> of what I would have expected.
> It seems that the functionality of
> SetAllowResponseInBrowserHistory
> works if set to False instead of being set to True, but only if
> NoCache isn't set previously.
> This is very strange, but I've seen stranger.
> I will escalate this up the line to PSS, and try to get a reply.
> When I do, I'll post it back.
>
> Before doing that, I'll wait for any last comments you might have.
> Thanks for pointing this out.
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Español
> Ven, y hablemos de ASP.NET...
> ======================
> <To********************@pandora.be> wrote in message
> news:a1**************************@news.microsoft.c om...
>> Hi Juan,
>>
>> I tried exactly the steps that you advised but this is where I
>> can't reproduce
>>
>>> If you set
>>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHist
>>> or y( False)
>>>
>> you'll see that immediately the "This page has expired" message
>> *is* displayed, and the client needs to resubmit the >page.
>>
>> I dont see the "This page has expired" message and if I comment
>> out SetAllowResponseInBrowserHistory I get the same result as
>> False is the default. No "This page has expired" message, the
>> browser request a new page as I can see by the time.
>>
>> Could it be that you saw this when testing without restarting IE?
>> I even made a video of my clean virtual machine (just SP2
>> installed) to show you my result.
>>
>> Please try this:
>> http://users.pandora.be/TomPester/ASP/r.rar
>> Do you realy get a "This page has expired" when you do what's on
>> the
>> video? I don't.
>> Setting SetAllowResponseInBrowserHistory to true or false... I
>> never see a difference.
>> Cheers,
>> Tom Pester
>>> re:
>>>
>>>>> You only need to set
>>>>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need
>>>>> to set it to true to override the NoCache setting
>>>>>
>>>> Setting SetAllowResponseInBrowserHistory to True doesn't
>>>> touch/override the "no-cache" value. It only removes the
>>>> expires=-1 header.
>>>>
>>> Maybe we have a semantics problem here.
>>>
>>> Removing the expires= -1 header *equals* overriding the
>>> "NoCache" value.
>>>
>>> When HttpCacheability is set to NoCache or ServerAndNoCache the
>>> Expires HTTP header is set to -1 by default.
>>>
>>> NoCache and ServerAndNoCache instruct the client to not cache
>>> responses in the History folder by setting that header.
>>>
>>> This means that each time you use the back/forward buttons, the
>>> client requests a new version of the response.
>>>
>>> When SetAllowResponseInBrowserHistory is set to True, the
>>> Expires HTTP header is removed.
>>>
>>> If you comment out this line :
>>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHist
>>> or y( Tr ue) and alternate between clicking the Submit button
>>> and the Back button, you'll see that the "This page has expired"
>>> message is not displayed.
>>>
>>> That means that the client *has* requested a new version of the
>>> page, without having to resubmit the page.
>>>
>>> If you set
>>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHist
>>> or y( Fa lse) you'll see that immediately the "This page has
>>> expired" message *is* displayed, and the client needs to
>>> resubmit the page.
>>>
>>> Now, if you set
>>> HttpContext.Current.Response.Cache.SetAllowRespons eInBrowserHist
>>> or
>>> y(
>>> Tr
>>> ue)
>>> and alternate between the Submit button and the Back button,
>>> you'll see that the "This page has expired" message is not
>>> displayed,
>>> and the page is displayed without needing to resubmit the page.
>>> The documentation is wrong in requesting that you
>>> "Click the Submit button a few times".
>>> That throws a wrench into the works.
>>> You should only hit it once to see the correct behavior.
>>> The documentation is also wrong when it states that
>>> SetAllowResponseInBrowserHistory allows client-side caching.
>>> In effect all it does is remove the need to resubmit the page.
>>> I hope this makes this issue clearer.
>>> Juan T. Llibre
>>> ASP.NET MVP
>>> http://asp.net.do/foros/
>>> Foros de ASP.NET en Español
>>> Ven, y hablemos de ASP.NET...
>>> ======================
>>> <To********************@pandora.be> wrote in message
>>> news:a1**************************@news.microsoft.c om...
>>>> Hi Juan,
>>>>
>>>> Thanks for your response.
>>>>
>>>>> You only need to set
>>>>> HttpCachePolicy.SetAllowResponseInBrowserHistory when you need
>>>>> to set it to true to override the NoCache setting
>>>>>
>>>> Setting SetAllowResponseInBrowserHistory to True doesn't
>>>> touch/override the "no-cache" value. It only removes the
>>>> expires=-1 header.
>>>>
>>>> This code shows this :
>>>> Response.Cache.SetCacheability(HttpCacheability.No Cache)
>>>> Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
>>>>
>>>> The servers send the following cache related headers :
>>>> 'Cache-Control: no-cache
>>>> 'Pragma: no - Cache
>>>> I don't know if you are experienced in http headers and their
>>>> behavior but could you please test the code that's on this page
>>>> and
>>>> report your result? :
>>>> http://msdn2.microsoft.com/library/9...us,vs.80).aspx
>>>> If you run the sample and go back with your browser I think you
>>>> will find that the text on the page is wrong.
>>>> Thanks in advance, Tom
>>>>

Nov 19 '05 #14
Hi Juan,

Any news from the folks at MS?

Cheers,
Tom Pester
Hi,

I think this question requires an in depth understanding of how a
browser cache works. I hope I can reach an expert here.

I may have found a quirk in the asp.net documentation or I don't
understand
what the SetAllowResponseInBrowserHistory does.
While researching caching I tried the code sample at the following
page :
http://msdn2.microsoft.com/library/9...us,vs.80).aspx

I find this code absurd since it tries to show that you can view a
page that has been _posted_ with the history feature of the browser.

Can you try this code and report your findings please? I tried it on a
clean
VM install and on my dev pc: the browser says "page expired".
The docs say you would see the old page in the browser.
I did some tests and this is what the following code does with the
response headers :

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Fa lse) '
False
is the default
'Cache-Control: no-cache
'Expires: -1
'Pragma: no - Cache
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(Tr ue)
'Cache-Control: no-cache
'Pragma: no - Cache
The docs are right about the Expires header. When
SetAllowResponseInBrowserHistory = True the Expires header disappears.

Does anybody have a clue why SetAllowResponseInBrowserHistory was
called into existence and where it might be useful?

Thanks,
Tom Pester

Nov 19 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jordan Rastrick | last post by:
First, a disclaimer. I am a second year Maths and Computer Science undergraduate, and this is my first time ever on Usenet (I guess I'm part of the http generation). On top of that, I have been...
1
by: Uenal Mutlu | last post by:
If "extern" is specified for a variable which is already in the same cpp file then the compiler (VS6) creates a new instance of the var in each thread. Is this a bug or a feature? Which is...
9
by: Just D. | last post by:
All, Did anybody see this strange effect? The web application is written in C#, ASP.NET, SQL, T-SQL, etc. A pretty usual stuff, complicated enough, but works fine until... Here is a question....
30
by: Raymond Hettinger | last post by:
Proposal -------- I am gathering data to evaluate a request for an alternate version of itertools.izip() with a None fill-in feature like that for the built-in map() function: >>> map(None,...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
4
by: RedHair | last post by:
Development: Windows 2003 Production :Windows 2003 ASP.NET 2.0 + C# I want to disable the cache feature of all pages in dev but enable it in production environments. What's the solution? If...
3
by: Dave | last post by:
Using ASP.Net 2.0 on Vista with IIS6, if I set a CacheDependency on a file into a Cache entry that I insert and then delete a subdirectory in the same directory that the file is located in then my...
7
by: Andrew Jocelyn | last post by:
Hi I'm running an ASP.NET web application under IIS. I'm inserting a cache object with a file based CacheDependency. I've noticed that when the file changes the Cache object is not always...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.