Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / July 2008

Tip: Looking for answers? Try searching our database.

Cache directives ignored by Firefox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 24 Jun 2008 10:22 GMT
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
Steven Cheng [MSFT] - 25 Jun 2008 04:58 GMT
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.aspx#notif
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/default.aspx.
==================================================
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,
>
[quoted text clipped - 14 lines]
>Thanks
>Paul
Paul - 25 Jun 2008 09:06 GMT
Thanks for your input. I logged a bug report with Mozilla.

> Hi Paul,
>
[quoted text clipped - 79 lines]
> >Thanks
> >Paul
Steven Cheng [MSFT] - 26 Jun 2008 04:04 GMT
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.aspx#notif
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.
>
[quoted text clipped - 40 lines]
>> ==================================================
>> Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> ications.
>>
[quoted text clipped - 13 lines]
>> --------------------
>> >From: =?Utf-8?B?UGF1bA==?= <vis@nospam.nospam>
Somayajulu - 12 Jul 2008 13:39 GMT
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.
Steven Cheng [MSFT] - 14 Jul 2008 03:31 GMT
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.aspx#notif
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
[quoted text clipped - 5 lines]
>Thanks!
>Som.
Jeffrey Wang - 21 Jul 2008 19:37 GMT
http://msdn.microsoft.com/en-us/library/system.web.httpcachepolicy.setallowrespo
nseinbrowserhistory.aspx


"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.

> =======================
>    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
[quoted text clipped - 8 lines]
>     End Sub
>  ==============================

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.