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 / January 2004

Tip: Looking for answers? Try searching our database.

Cache doesn't expire

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Victor - 14 Jan 2004 19:34 GMT
I use following code in Application_BeginRequest of
Global.asax.cs to expire cache:

Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Cache.SetExpires(DateTime.Now.AddMinutes(1));
Response.Expires = 1;
Response.ExpiresAbsolute = DateTime.Now.AddMinutes(1);   
       
However, after 1 minute cache didn't expire. I left my web
page for 10 minutes and cache didn't expire.

Any suggestions?

Thanks,
Victor
Alvin Bruney - 14 Jan 2004 21:06 GMT
How do you know the cache didnt expire? Are you putting a value in the cache
and trying to access it after the timeout?

Signature

Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b

> I use following code in Application_BeginRequest of
> Global.asax.cs to expire cache:
[quoted text clipped - 11 lines]
> Thanks,
> Victor
- 15 Jan 2004 13:50 GMT
I'm setting page to expire after 1 minute. Then going to
next page and waiting for over a minute before clicking
Back button. When I click back button after a minute,
page should expire but I'm still getting cached page.

Victor

>-----Original Message-----
>How do you know the cache didnt expire? Are you putting a value in the cache
[quoted text clipped - 17 lines]
>
>.
Alvin Bruney - 15 Jan 2004 17:34 GMT
ok change your option to
Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);

Signature

Regards,
Alvin Bruney
Got tidbits? Get it here...

> I'm setting page to expire after 1 minute. Then going to
> next page and waiting for over a minute before clicking
[quoted text clipped - 29 lines]
> >
> >.
Victor - 15 Jan 2004 19:44 GMT
Thanks for response.

I tried that before and it always shows you "Warning: Page Expired..." page
and asks user to press "Refresh" which is confusing and annoying to the
user.
Is there a way to expire page on Client's side after certain period of time
(lets say 10 minutes)
Like I said before, I thought
Response.Cache.SetExpires(DateTime.Now.AddMinutes(10)); will do that but for
some reason it doesn't work for me.
I tried to in insert <%@ OutputCache Duration="600" VaryByParam="None" %> in
aspx but it doesn't work either.

Thanks,
Victor

> ok change your option to
> Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
[quoted text clipped - 32 lines]
> > >
> > >.
Anders Borum - 16 Jan 2004 01:06 GMT
The 'Page Expired' probably happens, because you've got a "POST" request
associated with the page that has expired. When you try to navigate back to
that particular page, the browser will try POST the data back to the server
along with the rest of the HTTP request.

Because of the nature of HTTP POSTS, the browser 'asks' the user, if it
should actually POST the data again.

Signature

venlig hilsen / with regards
anders borum
--

Victor - 17 Jan 2004 13:49 GMT
Is there way to use BACK BUTTON (invoking HTTP POST) without invoking "Page
Expired"?

Victor

> The 'Page Expired' probably happens, because you've got a "POST" request
> associated with the page that has expired. When you try to navigate back to
[quoted text clipped - 3 lines]
> Because of the nature of HTTP POSTS, the browser 'asks' the user, if it
> should actually POST the data again.
Jerry III - 17 Jan 2004 17:07 GMT
No. The only thing you could do is to set the page to expire later than the
user would go back to it, but in that case the client would just load that
cached copy and not send you the request again.

Jerry

> Is there way to use BACK BUTTON (invoking HTTP POST) without invoking "Page
> Expired"?
[quoted text clipped - 15 lines]
> > anders borum
> > --

Rate this thread:







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.