[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

Cache directives ignored by Firefox

Paul

6/24/2008 9:22:00 AM

Hi,

I add the following to my aspx page code-behind (3.5). I've tried it in
several of the page events:

Response.Cache.SetNoStore()
Response.Cache.SetNoServerCaching()
Response.Cache.SetAllowResponseInBrowserHistory(False)
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(New Date(1900, 1, 1))
Response.Cache.SetLastModified(New Date(1900, 1, 1))

My page has a wizard, and the browser (Firefox 3), still caches the page and
I can use the browser back button to go to the previous wizard step, which I
don;t want. I want it to expire (in IE it does.) ANy ideas?

Thanks
Paul
6 Answers

stcheng

6/25/2008 3:58:00 AM

0

Hi Paul,

From your description, you're encountering some problem with disable
client-side browser cache in firefox browser.

Regarding on this, I've also performed some test on my side. Generally, the
following code should be necessary to disable client-side cache:

=======================
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Response.Cache.SetAllowResponseInBrowserHistory(False)
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetNoStore()
Response.Expires = 0

Response.Write("<br/>" & DateTime.Now.ToLongTimeString())

End Sub
==============================

And my local tests showed that it works corretly for IE7 and firefox 2.0.
However, for firefox 3.0, it does not work. I think it is due to the
implemenation of the firefox 3. BTW, the cache control http header is a
advisory info and the actual implemation is not mandatory and depend on the
browser, so I suggest you also try submit this issue to firefox community
to see whether this is an by design behavior.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/de....
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?UGF1bA==?= <vis@nospam.nospam>
>Subject: Cache directives ignored by Firefox
>Date: Tue, 24 Jun 2008 02:22:00 -0700

>Hi,
>
>I add the following to my aspx page code-behind (3.5). I've tried it in
>several of the page events:
>
> Response.Cache.SetNoStore()
> Response.Cache.SetNoServerCaching()
> Response.Cache.SetAllowResponseInBrowserHistory(False)
> Response.Cache.SetCacheability(HttpCacheability.NoCache)
> Response.Cache.SetExpires(New Date(1900, 1, 1))
> Response.Cache.SetLastModified(New Date(1900, 1, 1))
>
>My page has a wizard, and the browser (Firefox 3), still caches the page
and
>I can use the browser back button to go to the previous wizard step, which
I
>don;t want. I want it to expire (in IE it does.) ANy ideas?
>
>Thanks
>Paul
>

Paul

6/25/2008 8:06:00 AM

0

Thanks for your input. I logged a bug report with Mozilla.

"Steven Cheng [MSFT]" wrote:

> Hi Paul,
>
> From your description, you're encountering some problem with disable
> client-side browser cache in firefox browser.
>
> Regarding on this, I've also performed some test on my side. Generally, the
> following code should be necessary to disable client-side cache:
>
> =======================
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> Response.Cache.SetAllowResponseInBrowserHistory(False)
> Response.Cache.SetCacheability(HttpCacheability.NoCache)
> Response.Cache.SetNoStore()
> Response.Expires = 0
>
> Response.Write("<br/>" & DateTime.Now.ToLongTimeString())
>
> End Sub
> ==============================
>
> And my local tests showed that it works corretly for IE7 and firefox 2.0.
> However, for firefox 3.0, it does not work. I think it is due to the
> implemenation of the firefox 3. BTW, the cache control http header is a
> advisory info and the actual implemation is not mandatory and depend on the
> browser, so I suggest you also try submit this issue to firefox community
> to see whether this is an by design behavior.
>
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/de....
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --------------------
> >From: =?Utf-8?B?UGF1bA==?= <vis@nospam.nospam>
> >Subject: Cache directives ignored by Firefox
> >Date: Tue, 24 Jun 2008 02:22:00 -0700
>
> >Hi,
> >
> >I add the following to my aspx page code-behind (3.5). I've tried it in
> >several of the page events:
> >
> > Response.Cache.SetNoStore()
> > Response.Cache.SetNoServerCaching()
> > Response.Cache.SetAllowResponseInBrowserHistory(False)
> > Response.Cache.SetCacheability(HttpCacheability.NoCache)
> > Response.Cache.SetExpires(New Date(1900, 1, 1))
> > Response.Cache.SetLastModified(New Date(1900, 1, 1))
> >
> >My page has a wizard, and the browser (Firefox 3), still caches the page
> and
> >I can use the browser back button to go to the previous wizard step, which
> I
> >don;t want. I want it to expire (in IE it does.) ANy ideas?
> >
> >Thanks
> >Paul
> >
>
>

stcheng

6/26/2008 3:04:00 AM

0

Thanks for your reply Paul,

If you got any new information, also welcome to share with us.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

>From: =?Utf-8?B?UGF1bA==?= <vis@nospam.nospam>
>References: <6D5121F2-D78C-4E26-9D58-BBCE507842B6@microsoft.com>
<JPVsCfn1IHA.3644@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Cache directives ignored by Firefox
>Date: Wed, 25 Jun 2008 01:06:01 -0700

>
>Thanks for your input. I logged a bug report with Mozilla.
>
>"Steven Cheng [MSFT]" wrote:
>
>> Hi Paul,
>>
>> From your description, you're encountering some problem with disable
>> client-side browser cache in firefox browser.
>>
>> Regarding on this, I've also performed some test on my side. Generally,
the
>> following code should be necessary to disable client-side cache:
>>
>> =======================
>> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Me.Load
>> Response.Cache.SetAllowResponseInBrowserHistory(False)
>> Response.Cache.SetCacheability(HttpCacheability.NoCache)
>> Response.Cache.SetNoStore()
>> Response.Expires = 0
>>
>> Response.Write("<br/>" & DateTime.Now.ToLongTimeString())
>>
>> End Sub
>> ==============================
>>
>> And my local tests showed that it works corretly for IE7 and firefox
2.0.
>> However, for firefox 3.0, it does not work. I think it is due to the
>> implemenation of the firefox 3. BTW, the cache control http header is a
>> advisory info and the actual implemation is not mandatory and depend on
the
>> browser, so I suggest you also try submit this issue to firefox
community
>> to see whether this is an by design behavior.
>>
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> Delighting our customers is our #1 priority. We welcome your comments
and
>> suggestions about how we can improve the support we provide to you.
Please
>> feel free to let my manager know what you think of the level of service
>> provided. You can send feedback directly to my manager at:
>> msdnmg@microsoft.com.
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
>> ications.
>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each
follow
>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach
the
>> most efficient resolution. The offering is not appropriate for
situations
>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are
best
>> handled working with a dedicated Microsoft Support Engineer by
contacting
>> Microsoft Customer Support Services (CSS) at
>> http://msdn.microsoft.com/subscriptions/support/de....
>> ==================================================
>> This posting is provided "AS IS" with no warranties, and confers no
rights.
>> --------------------
>> >From: =?Utf-8?B?UGF1bA==?= <vis@nospam.nospam>
>>

Somayajulu

7/12/2008 12:39:00 PM

0

Steven,
This is displaying a confirmation message in Firefox 2.0 instead of expiring
the page.
It's only working with IE7.
Please let me know the way you got it working with Firefox 2.0 in your local
testing?

Thanks!
Som.

stcheng

7/14/2008 2:32:00 AM

0

Thanks for your input Som,

Yes, based on my test, it will display a message box in Firefox2 f or the
expireing info. Actually, when I choose to continue, the page will become
expire or I can choose not to. I assume this is the expect expire behavior
in Firefox as I haven't found the exact same behavior(like the one in IE).
Anyway, in firefox3 , even this behavior is not available.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

>Subject: RE: Cache directives ignored by Firefox
>Date: Sat, 12 Jul 2008 05:39:00 -0700
>Lines: 10

>
>Steven,
>This is displaying a confirmation message in Firefox 2.0 instead of
expiring
>the page.
>It's only working with IE7.
>Please let me know the way you got it working with Firefox 2.0 in your
local
>testing?
>
>Thanks!
>Som.
>
>

Jeffrey Wang

7/21/2008 6:37:00 PM

0

http://msdn.microsoft.com/en-us/library/system.web.httpcachepolicy.setallowresponseinbrowserhi...

"When HttpCacheability is set to NoCache or ServerAndNoCache the Expires
HTTP header is by default set to -1; this tells the client not to cache
responses in the History folder, so that when you use the back/forward
buttons the client requests a new version of the response each time. You can
override this behavior by calling the SetAllowResponseInBrowserHistory method
with the allow parameter set to true."


So, "Response.Cache.SetAllowResponseInBrowserHistory(False)" is really
unnecessary.

"Steven Cheng [MSFT]" wrote:
> =======================
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> Response.Cache.SetAllowResponseInBrowserHistory(False)
> Response.Cache.SetCacheability(HttpCacheability.NoCache)
> Response.Cache.SetNoStore()
> Response.Expires = 0
>
> Response.Write("<br/>" & DateTime.Now.ToLongTimeString())
>
> End Sub
> ==============================