Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page.Cache vs HttpContext.Current.Cache

Reply
Thread Tools

Page.Cache vs HttpContext.Current.Cache

 
 
DesignerX
Guest
Posts: n/a
 
      01-20-2004

What is the difference between Page.Cache and HttpContext.Current.Cache? Do
these access the same thing? Is there any easy way to clear all items in the
cache?

TIA,

Stan


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      01-20-2004
They are the same thing.

There is no Clear method for the Cache, so you would have to loop through it
and call Remove on each item to clear it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"DesignerX" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> What is the difference between Page.Cache and HttpContext.Current.Cache?

Do
> these access the same thing? Is there any easy way to clear all items in

the
> cache?
>
> TIA,
>
> Stan
>
>



 
Reply With Quote
 
 
 
 
vMike
Guest
Posts: n/a
 
      01-20-2004
I haven't had any luck with the remove method. What will work is something
like the following
Cookie = New HttpCookie("yourcookieidtoremove")
Cookie.Values.Add("yourcookievalueName,"")
cookie.expires=datetime.now.adddays(-5)
HttpContext.Current.Response.Cookies.add(Cookie)

This method will remove the cookie

"DesignerX" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> What is the difference between Page.Cache and HttpContext.Current.Cache?

Do
> these access the same thing? Is there any easy way to clear all items in

the
> cache?
>
> TIA,
>
> Stan
>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      01-20-2004
I don't recall anything in the question about cookies....

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"vMike" <(E-Mail Removed)> wrote in message
news:buk79p$mqu$(E-Mail Removed)...
> I haven't had any luck with the remove method. What will work is something
> like the following
> Cookie = New HttpCookie("yourcookieidtoremove")
> Cookie.Values.Add("yourcookievalueName,"")
> cookie.expires=datetime.now.adddays(-5)
> HttpContext.Current.Response.Cookies.add(Cookie)
>
> This method will remove the cookie
>
> "DesignerX" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > What is the difference between Page.Cache and HttpContext.Current.Cache?

> Do
> > these access the same thing? Is there any easy way to clear all items in

> the
> > cache?
> >
> > TIA,
> >
> > Stan
> >
> >

>
>



 
Reply With Quote
 
mikeb
Guest
Posts: n/a
 
      01-20-2004
vMike wrote:
> I haven't had any luck with the remove method. What will work is something
> like the following
> Cookie = New HttpCookie("yourcookieidtoremove")
> Cookie.Values.Add("yourcookievalueName,"")
> cookie.expires=datetime.now.adddays(-5)
> HttpContext.Current.Response.Cookies.add(Cookie)
>
> This method will remove the cookie


Cookies have nothing to do with the cache.


>
> "DesignerX" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>What is the difference between Page.Cache and HttpContext.Current.Cache?

>
> Do
>
>>these access the same thing? Is there any easy way to clear all items in

>
> the
>
>>cache?
>>
>>TIA,
>>
>>Stan
>>
>>

>
>
>



--
mikeb
 
Reply With Quote
 
vMike
Guest
Posts: n/a
 
      01-20-2004
Sorry, you're right. I thought I saw cookie. This will work

dim objItem as DictionaryEntry
dim strName as String

For Each objItem In Cache
strName = objItem.Key.tostring()
cache.remove(strName)
Next


"vMike" <(E-Mail Removed)> wrote in message
news:buk79p$mqu$(E-Mail Removed)...
> I haven't had any luck with the remove method. What will work is something
> like the following
> Cookie = New HttpCookie("yourcookieidtoremove")
> Cookie.Values.Add("yourcookievalueName,"")
> cookie.expires=datetime.now.adddays(-5)
> HttpContext.Current.Response.Cookies.add(Cookie)
>
> This method will remove the cookie
>
> "DesignerX" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > What is the difference between Page.Cache and HttpContext.Current.Cache?

> Do
> > these access the same thing? Is there any easy way to clear all items in

> the
> > cache?
> >
> > TIA,
> >
> > Stan
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments