how to make output cached page expire(refresh) before its duration completes

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

how to make output cached page expire(refresh) before its duration completes

 
0
  #1
Mar 5th, 2008
i output cached my .aspx page for a long period of time, now i want to change some markup on the page, how can i make it invalidate its cache(make it refresh it self)?
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: how to make output cached page expire(refresh) before its duration completes

 
0
  #2
Mar 5th, 2008
HttpResponse.RemoveOutputCacheItem("pathtoyourfile");
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: how to make output cached page expire(refresh) before its duration completes

 
0
  #3
Mar 5th, 2008
it gave an error indicating that "An absolute virtual path is expected" ?
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: how to make output cached page expire(refresh) before its duration completes

 
0
  #4
Mar 5th, 2008
Well you will need something like:
  1. HttpResponse.RemoveOutputCacheItem(Server.MapPath("/directory") & "file.aspx");
  2.  
  3. or just
  4.  
  5. HttpResponse.RemoveOutputCacheItem("/directory/file.aspx");
Not entirely sure, haven't used it in a while. Looong time.

Should work.. It's in C# for you too
Last edited by SheSaidImaPregy; Mar 5th, 2008 at 10:46 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: how to make output cached page expire(refresh) before its duration completes

 
0
  #5
Mar 5th, 2008
Come on shesaid.. why dont you ever try the code yourself and paste it? Please give me an accurate answer
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: how to make output cached page expire(refresh) before its duration completes

 
0
  #6
Mar 5th, 2008
Can't, I am at work and at work I work on a linux machine and have no access to FTP connections. Therefore I cannot test anything ^^
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: how to make output cached page expire(refresh) before its duration completes

 
0
  #7
Mar 5th, 2008
Well a way you can do it resides in just resetting the expiration the file

Set the expiration on the file to now or now + 1 second.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC