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 / November 2003

Tip: Looking for answers? Try searching our database.

RemoveOutputCacheItem question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bob chiverton - 03 Nov 2003 18:00 GMT
Can you tell me how to use this function? Can't find an
example ANYWHERE.

I don't understand the input parameter to this function.
For example, if I've enabled page output caching for
form1.aspx in my website:  

http://mysite/myapp/form1.aspx

then how would I explicitly flush that page from the page
output cache by clicking a button on another page? Here's
the button click handler:

form2.aspx.cs

private void Button1_Click(object sender, System.EventArgs
e)
 {
 HttpResponse.RemoveOutputCacheItem("/form1.aspx");
 }

but that doesn't seem to work. The official documention on
MSDN states that the path parameter represents:

"The physical path to the items that are removed from the
cache."

Well, this is unclear to me.....do I need a physical
location on the machine to a system cache location? Or a
physical location to the physical page location as it sits
in the website? An example from Microsoft would sure be
appreciated....

thanks,

bob
bb chiverton - 03 Nov 2003 19:21 GMT
ok...figured it out...the official documentation is in
error..it states:

public static void RemoveOutputCacheItem(string path);
where path = The physical path to the items that are
removed from the cache.

WRONG!

the path parameter must be an absolute virtual path to the
file you want to remove. So, if you want to remove

http://IP/yourWebsiteRoot/yourCachedFile.aspx

then call RemoveOutputCacheItem from another page on your
website (e.g., http://IP/yourWebsiteRoot/clearCache.aspx):

HttpResponse.RemoveOutputCacheItem
("/yourWebsiteRoot/yourCachedFile.aspx");

Also,  remember to specify Location='Server' in the cached
page's header:

<%@ OutputCache ... Location='Server' ...%>

Otherwise the cache deletion won't work because you've
cached the HTML output on the user's machine...

bob
>-----Original Message-----
>Can you tell me how to use this function? Can't find an
[quoted text clipped - 35 lines]
>
>.
Alvin Bruney - 03 Nov 2003 19:41 GMT
would you help microsoft help us by posting this as a bug to their support
website. that way, the documentation gets updated.

TIA

Signature

-----------
Got TidBits?
Get it here: www.networkip.net/tidbits

> ok...figured it out...the official documentation is in
> error..it states:
[quoted text clipped - 67 lines]
> >
> >.
bob - 03 Nov 2003 21:19 GMT
sure.

>-----Original Message-----
>would you help microsoft help us by posting this as a bug to their support
[quoted text clipped - 75 lines]
>
>.
bob - 03 Nov 2003 21:23 GMT
...how do I reach them to report this bug?
>-----Original Message-----
>sure.
[quoted text clipped - 92 lines]
>>
>.
Alvin Bruney - 04 Nov 2003 01:26 GMT
use this link
https://webresponse.one.microsoft.com/oas/public/assistedintro.aspx

Signature

-----------
Got TidBits?
Get it here: www.networkip.net/tidbits

> ...how do I reach them to report this bug?
> >-----Original Message-----
[quoted text clipped - 98 lines]
> >>
> >.

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



©2009 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.